refactor(react/svelte): cleanup types
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { useCallback } from 'react';
|
||||
import { getNodesInside } from '@reactflow/utils';
|
||||
import type { ReactFlowState } from '@reactflow/system';
|
||||
|
||||
import { useStore } from '../hooks/useStore';
|
||||
import type { Node, ReactFlowState } from '../types';
|
||||
|
||||
function useVisibleNodes(onlyRenderVisible: boolean) {
|
||||
const nodes = useStore(
|
||||
useCallback(
|
||||
(s: ReactFlowState) =>
|
||||
onlyRenderVisible
|
||||
? getNodesInside(s.nodeInternals, { x: 0, y: 0, width: s.width, height: s.height }, s.transform, true)
|
||||
? getNodesInside<Node>(s.getNodes(), { x: 0, y: 0, width: s.width, height: s.height }, s.transform, true)
|
||||
: s.getNodes(),
|
||||
[onlyRenderVisible]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user