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.
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...