refactor(editor): add propTypes

This commit is contained in:
moklick
2019-10-07 22:10:28 +02:00
parent 10e9777e27
commit 58841b5afd
2 changed files with 22 additions and 1 deletions

View File

@@ -1 +1,3 @@
# react-flow
# React Flow
React library for rendering interactive flow diagrams.

View File

@@ -1,4 +1,5 @@
import React, { useMemo } from 'react';
import PropTypes from 'prop-types';
import { StoreProvider } from 'easy-peasy';
if (process.env.NODE_ENV !== 'production') {
@@ -60,6 +61,24 @@ const ReactFlow = ({
ReactFlow.displayName = 'ReactFlow';
ReactFlow.propTypes = {
onElementClick: PropTypes.func,
onElementsRemove: PropTypes.func,
onNodeDragStop: PropTypes.func,
onConnect: PropTypes.func,
onLoad: PropTypes.func,
onMove: PropTypes.func,
nodeTypes: PropTypes.object,
edgeTypes: PropTypes.object,
connectionLineType: PropTypes.string,
connectionLineStyle: PropTypes.object,
deleteKeyCode: PropTypes.number,
selectionKeyCode: PropTypes.number,
gridColor: PropTypes.string,
gridGap: PropTypes.number,
showGrid: PropTypes.bool
};
ReactFlow.defaultProps = {
onElementClick: () => {},
onElementsRemove: () => {},