Setup Instructions
npx create-react-app todo
cd todo
- optional: delete a few files
cd src;rm -- App.test.js App.css logo.svg reportWebVitals.js setupTests.js
- note if you do this you will also have to remove imports & references to these
mkdir src/components
- change the title in
public/index.html
to "Todo with React" - copy app.starter.js into
src/App.js
(remove comments/*
*/
& replace the default App function) - copy index.starter.css into
src/index.css
(replace the content) - copy index.starter.js into
src/index.js
(replace the content) - now
npm run start
make sure you see all of the fields
Now you're ready to create components.
Teacher's soluition is in todo using components, props, state and useState() hook. Feel free to expand on it!
original exercise on MDN