# @monarcode/effetch-query/react-native (https://0758e0c7.effetch-query.pages.dev/docs/reference/react-native)

`@monarcode/effetch-query/react-native` builds a client's signals from React Native's own modules, which you pass in. Import what you use:

```ts
import { reactNativeSignals } from "@monarcode/effetch-query/react-native";
```

Its exports follow, grouped by the guide that covers them. Each one has
the first paragraph of its docs, and what it needs and how it fails; your
editor shows the rest, with an example, when you hover the name.

## React Native

Guide: [React Native](https://0758e0c7.effetch-query.pages.dev/docs/react/react-native).

### reactNativeSignals

Makes signals for React Native: focus is the app coming back to the foreground (`AppState` changing to `"active"` from anything else), and online follows NetInfo's `isConnected`, where `null` (not known yet) counts as online. Pass them as the `signals` option of `QueryClient.make`, in place of the default [`Signals.browser`](https://0758e0c7.effetch-query.pages.dev/docs/reference/signals#browser), which never changes without a DOM. The parameters are [`AppStateLike`](https://0758e0c7.effetch-query.pages.dev/docs/reference/react-native#appstatelike) and [`NetInfoLike`](https://0758e0c7.effetch-query.pages.dev/docs/reference/react-native#netinfolike).

Each client starts its own listeners when one of its queries first needs them, and stops them once no cached query does or the client is disposed, so one set of signals can serve several clients.

### AppStateLike

The part of React Native's `AppState` that [`reactNativeSignals`](https://0758e0c7.effetch-query.pages.dev/docs/reference/react-native#reactnativesignals) uses. `AppState` from `react-native` satisfies it, so this package never imports `react-native`.

### NetInfoLike

The part of NetInfo (`@react-native-community/netinfo`) that [`reactNativeSignals`](https://0758e0c7.effetch-query.pages.dev/docs/reference/react-native#reactnativesignals) uses. Its default export satisfies it, so this package never imports it.

### ReactNativeSignalsOptions

What [`reactNativeSignals`](https://0758e0c7.effetch-query.pages.dev/docs/reference/react-native#reactnativesignals) listens to.

| Prop       | Type     | Description                |
| ---------- | -------- | -------------------------- |
| `AppState` | `object` | React Native's `AppState`. |
| `NetInfo`  | `object` | NetInfo's default export.  |

## Related pages

- [Entry points](https://0758e0c7.effetch-query.pages.dev/docs/reference): what each entry point exports.
- [`@monarcode/effetch-query`](https://0758e0c7.effetch-query.pages.dev/docs/reference/core): the core entry point's namespaces and top-level names.
- [`Query`](https://0758e0c7.effetch-query.pages.dev/docs/reference/query): defining queries, keys and targets, and the cache from Effect.
- [`InfiniteQuery`](https://0758e0c7.effetch-query.pages.dev/docs/reference/infinite-query): queries that load a list one page at a time.
- [`Mutation`](https://0758e0c7.effetch-query.pages.dev/docs/reference/mutation): defining and running mutations.
- [`Entity`](https://0758e0c7.effetch-query.pages.dev/docs/reference/entity): records whose every cached copy a write updates.
- [`QueryClient`](https://0758e0c7.effetch-query.pages.dev/docs/reference/query-client): the client, its options and hooks, and server rendering.
- [`Signals`](https://0758e0c7.effetch-query.pages.dev/docs/reference/signals): where a client hears about focus and reconnects.
- [`@monarcode/effetch-query/react`](https://0758e0c7.effetch-query.pages.dev/docs/reference/react): the provider, the hooks and the boundaries.
- [`@monarcode/effetch-query/effetch`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch): queries and mutations from Effetch endpoints.
- [`@monarcode/effetch-query/react/tanstack-router`](https://0758e0c7.effetch-query.pages.dev/docs/reference/tanstack-router): connecting a client to TanStack Router and Start.