class App extends React.Component {
state: {
view: 'full'
}
renderHeader()
return (
<div>
<Header />
<HeaderControls />
</div>
);
}
render() {
return (
<div>
{ this.state.view === 'full' ? this.renderHeader() : null}
<MainContent />
</div>
);
}
}
{
"name": "redux_test_app",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-scripts": "2.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}