Skip to content

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 ​

ParameterType
nodeStatefulNode<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 ​

ParameterType
nodeNode
select(node) => Selected

Returns ​

Selected

Released under the MIT License.