main
js 22 lines 558 Bytes
Raw
1 import React from 'react';
2 import {useContext} from 'react';
3 import {Link} from 'react-router-dom';
4
5 import ThemeContext from './shared/ThemeContext';
6 import Clock from './shared/Clock';
7
8 export default function HomePage({counter, dispatch}) {
9 const theme = useContext(ThemeContext);
10 return (
11 <>
12 <h2>src/modern/HomePage.js</h2>
13 <h3 style={{color: theme}}>
14 This component is rendered by the outer React ({React.version}).
15 </h3>
16 <Clock />
17 <b>
18 <Link to="/about">Go to About</Link>
19 </b>
20 </>
21 );
22 }