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

Subscribe.md

34 lines648 Bytes

1---
2id: Subscribe
3title: Subscribe
4---
5​
6```ts
7function Subscribe<TSourceData, TSelected>(props): ComponentChildren;
8```
9​
10Defined in: [packages/preact-form/src/Subscribe.public.tsx:38](https://github.com/TanStack/form/blob/main/packages/preact-form/src/Subscribe.public.tsx#L38)
11​
12A Preact component that allows you to subscribe to source state.
13​
14This is useful for opting into state re-renders for specific parts of the state.
15​
16## Type Parameters
17​
18### TSourceData
19​
20`TSourceData`
21​
22### TSelected
23​
24`TSelected`
25​
26## Parameters
27​
28### props
29​
30[`SubscribeProps`](../interfaces/SubscribeProps.md)\<`TSourceData`, `TSelected`\>
31​
32## Returns
33​
34`ComponentChildren`