refactor(nodewrapper): use offsetWidth

This commit is contained in:
moklick
2019-08-19 16:22:06 +02:00
parent 311a18b769
commit 25991c80a9
7 changed files with 35 additions and 35 deletions
+6 -6
View File
@@ -8,12 +8,10 @@ import { parseElement, isNode, isEdge } from '../graph-utils';
export const GraphContext = createContext({});
export const Provider = (props) => {
const {
elements,
children,
} = props;
export const Provider = ({
elements,
children,
}) => {
const [state, dispatch] = useReducer(reducer, initialState);
useEffect(() => {
@@ -64,6 +62,8 @@ export const Provider = (props) => {
export const { Consumer } = GraphContext;
Provider.displayName = 'GraphProvider';
Provider.propTypes = {
elements: PropTypes.arrayOf(PropTypes.object)
};