From 8e7e700ede3a58d4b10e2352a0c7af7dfb63ed77 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 7 Dec 2018 10:13:08 +0100 Subject: [PATCH] remove unneccesary state from props --- src/components/organisms/Header.jsx | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/components/organisms/Header.jsx b/src/components/organisms/Header.jsx index e3659fa..fce3e84 100644 --- a/src/components/organisms/Header.jsx +++ b/src/components/organisms/Header.jsx @@ -22,24 +22,8 @@ export default class Header extends PureComponent { minimal: PropTypes.bool } - state = { isMinimal: this.props.minimal } - - checkMinimal = () => { - const { minimal } = this.props - - this.setState({ isMinimal: minimal }) - } - - componentDidMount() { - this.checkMinimal() - } - - componentDidUpdate() { - this.checkMinimal() - } - render() { - const { isMinimal } = this.state + const { minimal } = this.props return ( +
- + - + - +
) }}