Have you run into rerendering issues with passing functions that update state via Context? I think one solution is to memoize the functions, but I'm still experimenting with that.
No, I haven't run into any issues with that. I haven't used it enough yet to say that there are no issues with it. But my initial tests haven't revealed any problems... so far.
I'm playing around with something today and your question came to mind. If you want the context to be properly updated on state changes, you must be referencing it from within the render() function. I'm gonna do a follow-up post on this soon that will illustrate this. This might be part of the issue you've experienced.
It's not radically different from what I already highlighted. But it emphasizes the need to put the context references in the render() function. It also provides a few stylistic improvements to the first post...
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.
Have you run into rerendering issues with passing functions that update state via Context? I think one solution is to memoize the functions, but I'm still experimenting with that.
No, I haven't run into any issues with that. I haven't used it enough yet to say that there are no issues with it. But my initial tests haven't revealed any problems... so far.
I'm playing around with something today and your question came to mind. If you want the context to be properly updated on state changes, you must be referencing it from within the
render()
function. I'm gonna do a follow-up post on this soon that will illustrate this. This might be part of the issue you've experienced.Looking forward to it!
And... here it is:
dev.to/bytebodger/a-context-api-fr...
It's not radically different from what I already highlighted. But it emphasizes the need to put the context references in the
render()
function. It also provides a few stylistic improvements to the first post...