From c9d079ddc3fc9e9ec68aa5066338b9aa50108746 Mon Sep 17 00:00:00 2001 From: moklick Date: Tue, 16 May 2023 14:54:12 +0200 Subject: [PATCH 1/2] fix(updateNodeInternals): update type --- .../vite-app/src/examples/UseUpdateNodeInternals/CustomNode.tsx | 2 +- packages/core/src/types/general.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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[]; From 4374459ef9fec797bbc0407231f09a1acacd245b Mon Sep 17 00:00:00 2001 From: moklick Date: Tue, 16 May 2023 14:55:03 +0200 Subject: [PATCH 2/2] chore(changeset): add --- .changeset/wise-needles-kneel.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wise-needles-kneel.md 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