Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

SubscribeProps.md

84 lines1.6 KB

Defined in: packages/react-form/src/Subscribe.public.tsx:17

Subscribe to form.atom (full form state). The selector receives the full FormState.

Type Parameters

TSourceData

TSourceData

TSelected

TSelected

Properties

children

children: ReactNode | ((state) => ReactNode);

Defined in: packages/react-form/src/Subscribe.public.tsx:28


selector

selector: (state) => TSelected;

Defined in: packages/react-form/src/Subscribe.public.tsx:23

Select from full form state. Re-renders when the selected value changes (shallow compare).

Parameters

state

TSourceData

Returns

TSelected


source

source: SubscribeSource<TSourceData>;

Defined in: packages/react-form/src/Subscribe.public.tsx:18


when?

optional when?: (selected) => boolean;

Defined in: packages/react-form/src/Subscribe.public.tsx:27

Optional. If provided, the component will only render when the when function returns true.

Parameters

selected

NoInfer<TSelected>

Returns

boolean