Utilização

Display an offline hint

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>;
}

Propriedades e métodos 1

NomeTipoObrigatórioDescrição
valuesó de leituraNetworkStateSim—
value — campos aninhados

value campos

NomeTipoObrigatórioDescrição
typeNetworkStateTypeSim—
isConnectedbooleanSimA network is up. It may still lack internet access, as behind a captive portal.
isInternetReachablebooleanSimThe platform judges the network usable for the internet (docs/network.md).
detailsNetworkDetailsSim—
details — campos aninhados

details campos

NomeTipoObrigatórioDescrição
isExpensivebooleanSimTraffic may cost the user: cellular, a hotspot, or a network marked metered.
cellularGenerationCellularGenerationSimThe radio's generation on cellular; null elsewhere or when the platform won't say.
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.