-
Notifications
You must be signed in to change notification settings - Fork 8
Unexpected behaviour when Providing state #12
Comments
Hi Brad,
I'll have a look at it as soon as I'll be back from my holidays
Cheers,
George
…On Thu, Jul 26, 2018, 20:00 Brad Cornes ***@***.***> wrote:
Hi. I’m trying to update context from a nested component, similar to this
example in the React docs
<https://reactjs.org/docs/context.html#updating-context-from-a-nested-component>
.
However, preact-context doesn’t behave as expected (and as
React.createContext does).
Here’s an example:
preact-context: https://codesandbox.io/s/q3n91mr3nw
React.createContext: https://codesandbox.io/s/nrpx565z50
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#12>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABn8zKxXDU2U28_a2UIEAz4jn6k-T_lks5uKfXGgaJpZM4ViNQT>
.
|
Hey George, Sounds good, thanks! 😎 Had a quick look, and if I change the Lines 85 to 88 in 74217c0
|
Actually, although changing it to Edit: the issue on my project was actually caused by this preact bug, so you can disregard this comment |
@bradlc the problem is that preact mutates the state instance on each update hence the |
I'll try to catch up with some of the |
This issue is caused by using an older release of |
You’re right, updating the CodeSandbox to |
thanks a lot for the clarification @marvinhagemeister ! |
Hi. I’m trying to update context from a nested component, similar to this example in the React docs.
However,
preact-context
doesn’t behave as expected (and asReact.createContext
does).Here’s an example:
preact-context
: https://codesandbox.io/s/q3n91mr3nwReact.createContext
: https://codesandbox.io/s/nrpx565z50The text was updated successfully, but these errors were encountered: