import React, { useState } from 'react'; import ReactDOM from 'react-dom'; import { Typography, Paper, Container, } from "@material-ui/core"; import styled from 'styled-components'; import CssBaseline from '@material-ui/core/CssBaseline' import Header from './components/Header/Header'; import Scoreboard from "./components/Scoreboard/Scoreboard"; const App = () => { const [page, setPage] = useState('app'); return (
This is the {page} page! { (page === 'scoreboard')? () : (

This text is rendered outside of Header component, but interacting with Header can influence content of this page!

) }
); }; const Root = styled.div` background: cornsilk; padding-bottom: 25px; `; ReactDOM.render(, document.getElementById('root'));