refactor(on-error): use onError for node and edge type creation

This commit is contained in:
moklick
2023-08-14 16:31:37 +02:00
parent 0d8767ba14
commit 193f49cf87
5 changed files with 24 additions and 27 deletions
@@ -6,11 +6,10 @@ import useVisibleNodes from '../../hooks/useVisibleNodes';
import { useStore } from '../../hooks/useStore';
import { containerStyle } from '../../styles';
import { GraphViewProps } from '../GraphView';
import type { ReactFlowState, WrapNodeProps } from '../../types';
import type { NodeTypesWrapped, ReactFlowState, WrapNodeProps } from '../../types';
type NodeRendererProps = Pick<
GraphViewProps,
| 'nodeTypes'
| 'onNodeClick'
| 'onNodeDoubleClick'
| 'onNodeMouseEnter'
@@ -24,7 +23,9 @@ type NodeRendererProps = Pick<
| 'disableKeyboardA11y'
| 'nodeOrigin'
| 'nodeExtent'
>;
> & {
nodeTypes: NodeTypesWrapped;
};
const selector = (s: ReactFlowState) => ({
nodesDraggable: s.nodesDraggable,