Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from create-react-context to React 16 context API? #472

Closed
AndrewRayCode opened this issue Sep 3, 2018 · 2 comments
Closed

Switch from create-react-context to React 16 context API? #472

AndrewRayCode opened this issue Sep 3, 2018 · 2 comments

Comments

@AndrewRayCode
Copy link

I was investigating how the non-redux version works, and found you use create-react-context - should this be replaced with the new context API?

Also, for what it's worth, it was pretty confusing the non-redux package is called react-broadcast, for which there is already an npm package that has the same purpose as replacing the context api. I was looking for a while where react-broadcast was used, couldn't find it, and got more confused trying to figure out where context is coming from since there were no calls to createContext

@tdeekens
Copy link
Owner

tdeekens commented Sep 4, 2018

The initial version used react-broadcast as a broadcasting mechanism. I then moved to create-react-context which ponyfills the react context. So when you're on react 16 you will use the "native" new context api. I don't plan on changing the broadcasting package's name. The initial idea was to clearly distinguish the redux and broadcasting mechanism variants.

@tdeekens tdeekens closed this as completed Sep 4, 2018
@tdeekens
Copy link
Owner

tdeekens commented Sep 4, 2018

Eventually, in a breaking release some day I could also rename the package to react-context but I wonder if that's so much less confusing and causes more "pain" than it solves good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants