'Next.js authentication modals without redux

I have 5 modal dialogs with authentication forms (sign in, sign up, etc). Almost every modal can be called from footer and header. My problem is that i can't figure out how to structure my code so i don't have to propagate each modal dialog state from to header, footer and maybe somewhere else. On top of that each new modal dialog must close old one. I don't want to use redux because right now it's not that big of an app. Please help



Solution 1:[1]

You can use context api. it is almost similar to redux but it is builtIn for React so you don't need to install any other packages. you can read about this from the below link

.Context Api

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ali Ehyaie