Commit 865f123e authored by wildfirecode's avatar wildfirecode

1

parent 65ca0883
@import '~antd/dist/antd.css';
.App {
text-align: center;
}
......
import React from 'react';
import logo from './logo.svg';
import { Button } from 'antd';
import './App.css';
function App() {
const a = 1+2;
console.log(a)
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload....
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React5
</a>
</header>
</div>
);
const handleClick = async () => {
const response = await fetch('/api/todos');
const json = await response.json();
console.log(json.data);
}
const App = () => (
<div className="App">
<Button type="primary" onClick={handleClick}>Click Me!</Button>
</div>
);
export default App;
import React from 'react';
function Footer() {
const handleClick = async () => {
const response = await fetch('/api/todos');
const json = await response.json();
console.log(json.data);
}
return (
<div>
<button onClick={handleClick}>clickme!</button>
nothing here...
</div>
);
......
......@@ -7,8 +7,8 @@ import * as serviceWorker from './serviceWorker';
ReactDOM.render(
<React.StrictMode>
<Footer />
<App />
<Footer />
</React.StrictMode>,
document.getElementById('root')
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment