fix(rg): destruct props
This commit is contained in:
14
dist/ReactGraph.js
vendored
14
dist/ReactGraph.js
vendored
@@ -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
|
||||
|
||||
@@ -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 (
|
||||
<div style={style} className="react-graph">
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user