Chap03 -> Creating function-based components -> Creating a Header component

Chap03
Jason Zhu 2022-03-23 22:55:22 +11:00
parent 157120eb64
commit 95cb876ef5
2 changed files with 5 additions and 16 deletions

View File

@ -1,25 +1,11 @@
import React from 'react';
import logo from './logo.svg';
import { Header } from './Header';
import './App.css';
function App() {
return (
<div className="App">
<header className="App-header">
<ProblemComponent />
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<Header />
</div>
);
}

View File

@ -0,0 +1,3 @@
import React from 'react';
export const Header = () => <div>header</div>;