drcmda / react-contextual

🚀 react-contextual is a small (less than 1KB) helper around React 16s new context api
MIT License
642 stars 23 forks source link

Named Context not working as expected? #8

Closed JJLost closed 6 years ago

JJLost commented 6 years ago

CodeSanbox altered "multiple context" example

Just wondering if i misused the framework or there is something wrong. I would expect the Greet function to update similar to how the Hello component does.

Any thoughts?

drcmda commented 6 years ago

@JJLost no, it absolutely should work. Strange that it doesn't.

I updated the dependencies in that sandbox and now it seems to be ok: https://codesandbox.io/s/o53o7kq8k9

I tested it against the react alpha (in which case it doesn't use the polyfill) and against the current stable react (and react-broadcast as polyfill). Both seem to be ok. I guess either a bug in the old contextual or react 16.0.0.