diff --git a/src/components/Handle/index.tsx b/src/components/Handle/index.tsx index 61b245f8..44d686d5 100644 --- a/src/components/Handle/index.tsx +++ b/src/components/Handle/index.tsx @@ -15,10 +15,8 @@ const Handle = memo( ...rest }: HandleProps) => { const nodeId = useContext(NodeIdContext) as ElementId; - const { setPosition, setSourceId } = useStoreActions((a) => ({ - setPosition: a.setConnectionPosition, - setSourceId: a.setConnectionSourceId, - })); + const setPosition = useStoreActions((a) => a.setConnectionPosition); + const setSourceId = useStoreActions((a) => a.setConnectionSourceId); const onConnectAction = useStoreState((s) => s.onConnect); const onConnectExtended = (params: Connection) => { onConnectAction(params); diff --git a/src/components/UserSelection/index.tsx b/src/components/UserSelection/index.tsx index 94b32daa..1922e200 100644 --- a/src/components/UserSelection/index.tsx +++ b/src/components/UserSelection/index.tsx @@ -45,11 +45,9 @@ const SelectionRect = () => { }; export default memo(({ isInteractive }: UserSelectionProps) => { - const { setUserSelection, updateUserSelection, unsetUserSelection } = useStoreActions((a) => ({ - setUserSelection: a.setUserSelection, - updateUserSelection: a.updateUserSelection, - unsetUserSelection: a.unsetUserSelection, - })); + const setUserSelection = useStoreActions((a) => a.setUserSelection); + const updateUserSelection = useStoreActions((a) => a.updateUserSelection); + const unsetUserSelection = useStoreActions((a) => a.unsetUserSelection); if (!isInteractive) { return null;