diff --git a/.changeset/curly-kangaroos-clap.md b/.changeset/curly-kangaroos-clap.md new file mode 100644 index 00000000..c2e617fc --- /dev/null +++ b/.changeset/curly-kangaroos-clap.md @@ -0,0 +1,5 @@ +--- +'@xyflow/react': patch +--- + +Improve `onNodesChange` docs diff --git a/packages/react/src/types/component-props.ts b/packages/react/src/types/component-props.ts index 64b94534..63f0a1be 100644 --- a/packages/react/src/types/component-props.ts +++ b/packages/react/src/types/component-props.ts @@ -156,14 +156,14 @@ export interface ReactFlowProps) - * @example // Use helper function to update edge + * @example // Use helper function to update node * import ReactFlow, { applyNodeChanges } from '@xyflow/react'; * * const onNodeChange = useCallback( - * (changes) => setNode((eds) => applyNodeChanges(changes, eds)), + * (changes) => setNode((nds) => applyNodeChanges(changes, nds)), * [], * ); *