network.state
The network now. Watched, it follows each change; the platform monitors only then.
Usage
Display an offline hint
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>;
}Properties and methods 1
| Name | Type | Required | Description |
|---|---|---|---|
valuereadonly | NetworkState | Yes | — |
value — nested fields
value fields
| Name | Type | Required | Description |
|---|---|---|---|
type | NetworkStateType | Yes | — |
isConnected | boolean | Yes | A network is up. It may still lack internet access, as behind a captive portal. |
isInternetReachable | boolean | Yes | The platform judges the network usable for the internet (docs/network.md). |
details | NetworkDetails | Yes | — |
details — nested fields
details fields
| Name | Type | Required | Description |
|---|---|---|---|
isExpensive | boolean | Yes | Traffic may cost the user: cellular, a hotspot, or a network marked metered. |
cellularGeneration | CellularGeneration | Yes | The radio's generation on cellular; null elsewhere or when the platform won't say. |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.