API Reference
useNodeInput()
Bind a writable GraphReFly node as [value, setValue].
The setter identity is stable for a stable node identity, and writes through the node's reactive DATA boundary rather than a presentation-owned trigger.
Import
import { useNodeInput } from "@graphrefly/ts/adapters/react";
Signature
function useNodeInput(node: WritableNode<T>): readonly [T | undefined, (value: T) => void]
Parameters
| Parameter | Type | Description |
|---|---|---|
node | WritableNode<T> | Node to observe, adapt, or connect. |
Returns
A readonly [T | undefined, (value: T) => void] value.
Example
import { useNodeInput } from "@graphrefly/ts/adapters/react";
Source
packages/ts/src/adapters/react.ts