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?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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 auseCallback
around theopenConfirmation
declaration (with asetConfirmationState
dependency) and it seemed to do the trick. Can anyone verify that this is the right way to go about this?