refactor(app): use memo fpr comps

This commit is contained in:
moklick
2019-07-25 15:16:59 +02:00
parent 3ecd00d027
commit bfeefd51b2
6 changed files with 19 additions and 21 deletions
+3 -3
View File
@@ -1,11 +1,11 @@
import { useEffect, useContext } from 'react';
import { useEffect, useContext, memo } from 'react';
import { useKeyPress } from '../hooks';
import { setNodesSelection } from '../state/actions';
import { GraphContext } from '../GraphContext';
import { isEdge, getConnectedEdges } from '../graph-utils';
export default (props) => {
export default memo((props) => {
const { state, dispatch } = useContext(GraphContext);
const removePressed = useKeyPress('Backspace');
@@ -25,4 +25,4 @@ export default (props) => {
}, [removePressed])
return null;
};
});