diff --git a/dist/ReactGraph.js b/dist/ReactGraph.js index c45d6fee..e98f12f9 100644 --- a/dist/ReactGraph.js +++ b/dist/ReactGraph.js @@ -33884,6 +33884,8 @@ onElementClick = _ref.onElementClick, elements = _ref.elements, children = _ref.children, + nodeTypes = _ref.nodeTypes, + edgeTypes = _ref.edgeTypes, onLoad = _ref.onLoad, onMove = _ref.onMove, onElementsRemove = _ref.onElementsRemove, @@ -33891,11 +33893,11 @@ onNodeDragStop = _ref.onNodeDragStop, connectionLineType = _ref.connectionLineType, connectionLineStyle = _ref.connectionLineStyle; - var nodeTypes = React.useMemo(function () { - return createNodeTypes(props.nodeTypes); + var nodeTypesParsed = React.useMemo(function () { + return createNodeTypes(nodeTypes); }, []); - var edgeTypes = React.useMemo(function () { - return createEdgeTypes(props.edgeTypes); + var edgeTypesParsed = React.useMemo(function () { + return createEdgeTypes(edgeTypes); }, []); return React__default.createElement("div", { style: style, @@ -33907,8 +33909,8 @@ onMove: onMove, onElementClick: onElementClick, onNodeDragStop: onNodeDragStop, - nodeTypes: nodeTypes, - edgeTypes: edgeTypes, + nodeTypes: nodeTypesParsed, + edgeTypes: edgeTypesParsed, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, onConnect: onConnect diff --git a/src/ReactGraph/index.js b/src/ReactGraph/index.js index d7af4493..629285bf 100644 --- a/src/ReactGraph/index.js +++ b/src/ReactGraph/index.js @@ -23,11 +23,11 @@ import '../style.css'; const ReactGraph = ({ style, onElementClick, elements, children, - onLoad, onMove, onElementsRemove, onConnect, - onNodeDragStop, connectionLineType, connectionLineStyle + nodeTypes, edgeTypes, onLoad, onMove, onElementsRemove, + onConnect, onNodeDragStop, connectionLineType, connectionLineStyle }) => { - const nodeTypes = useMemo(() => createNodeTypes(props.nodeTypes), []); - const edgeTypes = useMemo(() => createEdgeTypes(props.edgeTypes), []); + const nodeTypesParsed = useMemo(() => createNodeTypes(nodeTypes), []); + const edgeTypesParsed = useMemo(() => createEdgeTypes(edgeTypes), []); return (
@@ -37,8 +37,8 @@ const ReactGraph = ({ onMove={onMove} onElementClick={onElementClick} onNodeDragStop={onNodeDragStop} - nodeTypes={nodeTypes} - edgeTypes={edgeTypes} + nodeTypes={nodeTypesParsed} + edgeTypes={edgeTypesParsed} connectionLineType={connectionLineType} connectionLineStyle={connectionLineStyle} onConnect={onConnect}