drcmda / react-contextual

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

dependency on react-broadcast? #10

Closed ehahn9 closed 6 years ago

ehahn9 commented 6 years ago

Is there really a dependency on react-broadcast (seen in package.json but maybe not in the implementation)?

drcmda commented 6 years ago

@ehahn9 Only until react 16.4.0 is out, which will be shortly. You can already update to react@next/react-dom@next and it'll use native context but until then it needs to be polyfilled. If you need it i can release a @next as well without broadcast in it.

ehahn9 commented 6 years ago

Thanks @drcmda! I'm still at the investigation phase, so I'd hate to make any work for you - no need to do anything about the dependency!

react-contextual seems like a GREAT alternative to unstated which is getting a lot of airplay.

drcmda commented 6 years ago

@ehahn9 Thanks! Unstated follows a similar idea, but doesn't consider the performance hit of context. Without mapContextToProps in a real world application everything will render on everything.