Build an app that has the following functionality:
- Users can create a new Todo by typing text into an
input
inside aform
and pressing enter - Shows a list of todos with id
#todos
underneath that input- Use an instance of a
Todo
component for each of the Todos
- Use an instance of a
- Users can delete an existing Todo by pressing an 'x'
button
next to it
When a todo is created or deleted, a pop-up "toast" will appear to notify the user that the action has been completed. Implement lifecycle methods to fire the created/deleted notifications:
- Use
componentDidMount
inTodo
to show a"success"
toast with the textNew todo added: {todo}
- Use
componentWillUnmount
inTodo
to show an"error"
toast with the textTodo deleted: {todo}
For the toasts notifications, use the react-toastify library that has already been installed with this lab. See its README.md for example usage; you might find the react-toastify gist or the demo playground very helpful in getting started.
Use componentDidUpdate
in App
to show a toast with the text Remaining todos: {count}
whenever the count of todos changes.
- Fork this repo
- Clone the forked repository
cd
to the directory where you cloned itnpm install
to install dependenciesnpm run cypress
to open the cypress testing window
Note: Remember to
git add
,git commit
andgit push
regularly
- When finished, commit and push your work.
- Make a pull request on github.
- Submit the link to your pull request on Canvas.