refactor(react): use array for nodeInternals, rename to nodes
This commit is contained in:
@@ -3,7 +3,7 @@ import { shallow } from 'zustand/shallow';
|
||||
import { useStore } from '../hooks/useStore';
|
||||
import type { Node, ReactFlowState } from '../types';
|
||||
|
||||
const nodesSelector = (state: ReactFlowState) => state.getNodes();
|
||||
const nodesSelector = (state: ReactFlowState) => state.nodes;
|
||||
|
||||
function useNodes<NodeData>(): Node<NodeData>[] {
|
||||
const nodes = useStore(nodesSelector, shallow);
|
||||
|
||||
Reference in New Issue
Block a user