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 Timer from './components/Timer/Timer'; import Scoreboard from "./components/Scoreboard/Scoreboard"; const App = () => { const [page, setPage] = useState('app'); const getPageComponent = page => { switch (page) { case 'app': return (); case 'scoreboard': return (); default: return (

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

) } }; const classes = useStyles(); return (
This is the {page} page! { getPageComponent(page)} ); }; const Root = styled.div` background: cornsilk; padding-bottom: 25px; `; ReactDOM.render(, document.getElementById('root'));