blob: bf09082681800c390c8dc32a9623358fbc030ee8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import styled from 'styled-components';
import CssBaseline from '@material-ui/core/CssBaseline'
import Header from "./components/Header";
const App = () => {
const [page, setPage] = useState('home');
return (
<Root>
<CssBaseline/>
<Header setPage={setPage} />
<h1> This is the {page} page! </h1>
<p>
This text is rendered outside of <code>Header</code> component, but
interacting with <code>Header</code> can influence content of this page!
</p>
</Root>
);
};
const Root = styled.div`
background: cornsilk;
padding-bottom: 25px;
`;
ReactDOM.render(<App />, document.getElementById('root'));
|