NativeCustomView
packages/ui-native/src/data/NativeCustomView.tsx
Import
Subpath export:
@marktiderman/genesis-ui-native/dataimport { NativeCustomView } from "@marktiderman/genesis-ui-native/data";Components
Auto-generated from TypeScript source via
react-docgen-typescript.useNativeCustomView
A native custom view's data and states, headless. `<NativeCustomView>` calls it and draws the states.
No declared props.
NativeCustomView
| Prop | Type | Default | Description |
|---|---|---|---|
| children* | (state: NativeCustomViewState<T>) => ReactNode | — | Draws the view once there's something to show. |
| view* | AnyResourceView<T> | — | |
| can | NativeResourceScreenCan<T> | — | The screen's own rule. It only narrows the view's guards. |
| empty | ReactNode | — | Replaces the empty state; `false` hands an empty view to `children` too. |
| enabled | boolean | — | False while another type (a board, a calendar) draws the rows: the list reads nothing. Default true. |
| error | ReactNode | ((error: string, retry: () => void) => ReactNode) | — | Replaces the error state; a function gets the error and a retry. |
| filter | Readonly<Record<string, string | number | boolean | readonly (string | number)[] | null>> | — | Filters sent to the server (`{ client_id: id }`); `null` means "is empty" and a list means "any of" (`{ status: ["open", "blocked"] }`, sent as `in`; a create never takes a list). A create also saves every non-null value here (a tab's filter too), even for read-only fields such as a required link: they come from the screen, never from an input. An edit never sends them. |
| listFilters | readonly FilterParam[] | — | The list state's filters (core `useListState`: a segment and the declared filters), on top of the screen's. |
| live | boolean | — | Refetch loaded pages when the provider reports a change. |
| loading | ReactNode | — | |
| maxPages | number | — | Pages kept loaded when the provider pages by cursor (and serves `prevCursor`): scrolling far drops pages from the front, and scrolling back to the top loads them again (`loadPrevious` on the list's `onStartReached`, with `maintainVisibleContentPosition` so the rows on screen stay put). Offset paging never drops pages. Default 10. |
| perPage | number | — | Rows per page. Default 25. |
| preset | string | — | A tab the view defines: its server filter. |
| searchFields | string[] | — | Fields the search box searches. Default: the view's `labelField`. |
| testID | string | custom-view |