network.NetworkStateType
The transport of the network the system routes traffic through.
Utilização
Display an offline hint
Este tipo é usado por network.state
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>;
}Declaração do tipo
export type NetworkStateType = StateType;Tipo
"none" | "unknown" | "wifi" | "cellular" | "ethernet"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.