r/reactjs • u/rats4final • May 08 '26
Discussion Best way to manage global modals/dialogs?
Like the title says what is the best or most escalable way to do this? I know there are some libraries like nice modal or that one that dude made it was shadcn modal manager I think, or I could even do my own global modal with a bit of context or zustand, but I was wondering what is the best way to this, I mostly need this so I don't want to repeat myself wrapping every form I make in a modal component, but I am wondering how to scaffold it, also should my form component have a onSuccess optional function, should the cancel and submit buttons live in each form or in the modal abstraction?