In this blog, we see how to manage our state with ContextAPI, which is easy and more powerful in React. Without drilling props to props... context API makes our lives easier🤟.
Here I've created the useContext and pass it to the value of my name. This name value we can get anywhere on the folder by importing the useContext Hook.
Make sure to import your NameProvider and wrap up the parent component, it gives the access to pass the value inside all the children.
Really this is easy😎 and cool, I just gave a 🧑💻demo by using a single file, if your app goes longer and longer, you can create the multiple create context and import where you want.