docs(readme): add react flow instance section

This commit is contained in:
moklick
2020-06-02 12:26:12 +02:00
parent 2d4a64d341
commit d95fc1279a
9 changed files with 57 additions and 30 deletions
+1 -4
View File
@@ -3,10 +3,7 @@ import React, { useState } from 'react';
import ReactFlow, { removeElements, addEdge, MiniMap, isNode, Controls, Background } from 'react-flow-renderer';
import { getElements } from './utils';
const onLoad = graph => {
console.log('graph loaded:', graph);
graph.fitView();
};
const onLoad = reactFlowInstance => reactFlowInstance.fitView();
const initialElements = getElements(10, 10);