Building a Notify Hook

In this lesson, analyze a basic React application that requires notification functionality. Learn how you can use a custom hook to handle repetitive logic.

A sample application

It is a common scenario in React applications to show notifications to the user when a certain action is successfully completed or when there is any error while processing the user’s request.

Start learning by looking at the following illustration.

The illustration shows an application where the user is adding personal information to their profile by using an online form. In such cases, the user may have the ability to save one of following details:

  • Name
  • Password
  • Mailing address
  • Email preferences

And the list goes on.

Each of these fields can have a Save button to submit data to the back-end allowing it to save it to the profile.

Get hands-on with 1200+ tech skills courses.