moving on with the lesson
This commit is contained in:
parent
315a22614c
commit
f1916e5c56
4 changed files with 809 additions and 23 deletions
|
|
@ -1,24 +1,11 @@
|
|||
import ReactDOM from 'react-dom/client'
|
||||
import App from './App'
|
||||
import ReactDOM from "react-dom/client";
|
||||
import App from "./App";
|
||||
|
||||
const notes = [
|
||||
{
|
||||
id: 1,
|
||||
content: 'HTML is easy',
|
||||
important: true
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
content: 'Browser can execute only JavaScript',
|
||||
important: false
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
content: 'GET and POST are the most important methods of HTTP protocol',
|
||||
important: true
|
||||
}
|
||||
]
|
||||
import axios from "axios";
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||
<App startingNotes={notes} />
|
||||
)
|
||||
axios.get("http://localhost:3001/notes").then((response) => {
|
||||
const notes = response.data;
|
||||
ReactDOM.createRoot(document.getElementById("root")).render(
|
||||
<App startingNotes={notes} />
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue