changed useFlow declaration from destructuring to selector to improve performance
This commit is contained in:
parent
68e5454b11
commit
503e7766ba
12 changed files with 49 additions and 27 deletions
|
|
@ -72,7 +72,10 @@ export default function ParameterComponent({
|
|||
const updateNodeInternals = useUpdateNodeInternals();
|
||||
const [position, setPosition] = useState(0);
|
||||
const { tabId, flows } = useContext(FlowsContext);
|
||||
const { nodes, edges, setNode } = useFlow();
|
||||
const nodes = useFlow((state) => state.nodes);
|
||||
const edges = useFlow((state) => state.edges);
|
||||
const setNode = useFlow((state) => state.setNode);
|
||||
|
||||
|
||||
const flow = flows.find((flow) => flow.id === tabId)?.data?.nodes ?? null;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue