re: The neatest way to handle alert dialogs in React 🥰 VIEW POST


I know it's a bit late but thanks for the post, I found it really helpful! I was wondering whether or not using this service across multiple components would trigger a rerender for any component using the context any time a component called the confirm function and it seemed like it did. I added a useCallback around the openConfirmation declaration (with a setConfirmationState dependency) and it seemed to do the trick. Can anyone verify that this is the right way to go about this?

code of conduct - report abuse