diff --git a/.changeset/wise-needles-kneel.md b/.changeset/wise-needles-kneel.md new file mode 100644 index 00000000..5deec8b6 --- /dev/null +++ b/.changeset/wise-needles-kneel.md @@ -0,0 +1,5 @@ +--- +'@reactflow/core': patch +--- + +fix useUpdateNodeInternals type diff --git a/examples/vite-app/src/examples/UseUpdateNodeInternals/CustomNode.tsx b/examples/vite-app/src/examples/UseUpdateNodeInternals/CustomNode.tsx index 1684656b..1b25bdc1 100644 --- a/examples/vite-app/src/examples/UseUpdateNodeInternals/CustomNode.tsx +++ b/examples/vite-app/src/examples/UseUpdateNodeInternals/CustomNode.tsx @@ -1,4 +1,4 @@ -import React, { useState, memo, FC, useMemo, CSSProperties } from 'react'; +import { useState, memo, FC, useMemo, CSSProperties } from 'react'; import { Handle, Position, NodeProps, useUpdateNodeInternals } from 'reactflow'; const nodeStyles: CSSProperties = { padding: 10, border: '1px solid #ddd' }; diff --git a/packages/core/src/types/general.ts b/packages/core/src/types/general.ts index 9803d4a0..d6c2e33b 100644 --- a/packages/core/src/types/general.ts +++ b/packages/core/src/types/general.ts @@ -257,7 +257,7 @@ export type ReactFlowActions = { export type ReactFlowState = ReactFlowStore & ReactFlowActions; -export type UpdateNodeInternals = (nodeId: string) => void; +export type UpdateNodeInternals = (nodeId: string | string[]) => void; export type OnSelectionChangeParams = { nodes: Node[];