Function: useNodeState()
Call Signature
ts
function useNodeState<Value>(node): NodeState<Value>;Defined in: react/src/use-node-state.ts:31
Returns the node's state and re-renders the component when any of it changes.
Type Parameters
| Type Parameter |
|---|
Value |
Parameters
| Parameter | Type |
|---|---|
node | StatefulNode<Value> |
Returns
NodeState<Value>
Call Signature
ts
function useNodeState<Node, Selected>(node, select): Selected;Defined in: react/src/use-node-state.ts:36
Returns what select reads from the node and re-renders the component only when that changes. Results are compared shallowly, so select may return a new object or array of the values it read.
Type Parameters
| Type Parameter |
|---|
Node extends StatefulNode<unknown> |
Selected |
Parameters
| Parameter | Type |
|---|---|
node | Node |
select | (node) => Selected |
Returns
Selected