diff --git a/src/components/Layout/Layout.js b/src/components/Layout/Layout.js index e105003..de610fe 100644 --- a/src/components/Layout/Layout.js +++ b/src/components/Layout/Layout.js @@ -26,7 +26,7 @@ class Layout extends Component {
- {this.state.children} + {this.props.children}
diff --git a/src/components/UI/Modal/Modal.js b/src/components/UI/Modal/Modal.js index 4a3e780..e3452a3 100644 --- a/src/components/UI/Modal/Modal.js +++ b/src/components/UI/Modal/Modal.js @@ -1,26 +1,32 @@ -import React from 'react'; +import React, { Component } from 'react'; import Aux from '../../../hoc/Auxiliary'; import Backdrop from '../Backdrop/Backdrop'; import classes from './Modal.css'; -const modal = (props) => { - return ( - - -
- {props.children} -
+class Modal extends Component { -
- ); -}; + shouldComponentUpdate(nextProps, nextState){ + return nextProps.show !== this.props.show; + } -export default modal; \ No newline at end of file + render() { + return ( + + +
+ {this.props.children} +
+
+ ); + } +} + +export default Modal; \ No newline at end of file