React state management is a broad topic, and choosing the right management tool is often difficult. React is known for its missing state management tool often leaving it to the developer to figure it out. However, over the years, some great tools have emerged giving the developer some powerful features.

This article we will use Recoil to build an alert component, but you can apply the same principles in any state management tool you choose.

If you want to just jump into the code here is the repo for the whole project:


I will be starting the project from a starter project I created called, Next.js Tailwind CSS Starter. You can find the code repo here:

So I am starting my project using Next.js and Tailwind CSS to easily get something off the ground without too much configuration. You can git clone this repo if you want a starting point.


Now that I have my starter project ready to go, all I need now is to install Recoil.
npm install recoil

#recoil #react #nextjs #javascript

How to Build an Alert Component Using Recoil
1.55 GEEK