Verwendung

Display an offline hint

Dieser Typ wird verwendet von network.state

tsx
import { Text, network } from 'kuito';

network.state.value; // the state now, synchronously
await network.refresh(); // the same, read off the JS thread

function OfflineBanner() {
  return <Text>{network.state.value.isInternetReachable ? '' : 'You are offline'}</Text>;
}

Typdeklaration

ts
export type NetworkState = State;

Mitglieder 4

NameTypErforderlichBeschreibung
typeNetworkStateTypeJa—
isConnectedbooleanJaA network is up. It may still lack internet access, as behind a captive portal.
isInternetReachablebooleanJaThe platform judges the network usable for the internet (docs/network.md).
detailsNetworkDetailsJa—
details — verschachtelte Felder

details Felder

NameTypErforderlichBeschreibung
isExpensivebooleanJaTraffic may cost the user: cellular, a hotspot, or a network marked metered.
cellularGenerationCellularGenerationJaThe radio's generation on cellular; null elsewhere or when the platform won't say.
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.