Closed nandorojo closed 4 years ago
Is there a specific use case to describe the times where it’s causing re-renders? I’m not against the idea, but I don’t want to optimize/memorize too soon or unnecessarily.
I actually got around it, so I'll close this for now.
Calling a function in an effect is a use case, as seen here: https://github.com/thetrevorharmon/gatsby-theme-shopify-manager/issues/60
Currently, the useful hooks look like this:
I'd like to propose changing them to this:
This is a performance optimization that makes it easier to pass them around to components, to trigger fewer re-renders.
What do you think? I'm happy to help with a PR if you'd prefer.