react-tunnel icon indicating copy to clipboard operation
react-tunnel copied to clipboard

prop-types warning

Open natew opened this issue 7 years ago • 5 comments

Get this when using react-tunnel:

Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.

from:

function createProvider(React) {
  var Component = React.Component;
  var PropTypes = React.PropTypes;

natew avatar Jun 18 '17 00:06 natew

Would you release a fix if I submit a PR?

natew avatar Aug 23 '17 16:08 natew

this now errors Cannot read property 'object' of undefined

any chance you can publish a new version with the fix?

alanshaw avatar Oct 11 '17 13:10 alanshaw

Hey there, I found this library fits is super well with my needs!

I had done some minors tweaks mostly on the tests and published react-tunnel-16 and made it work finely with CRA still need to figure how to make it work with react-native + react 16.

I will send a PR once I have the tests passing.

agrcrobles avatar Dec 01 '17 18:12 agrcrobles

@agrcrobles I'll look for the PR

Please note however that this lib is subject to the same limitations of context that say react-router is where a connected component can easily block updates. Have you looked at https://github.com/ReactTraining/react-broadcast instead? it implements a subscription model to avoid this and I would probably use this lib for my own future needs for this reason alone.

If you aren't using shouldComponentUpdate then react-tunnel should still work well but that's a fairly large limitation.

gnoff avatar Dec 01 '17 23:12 gnoff

Thanks for the advice @gnoff! I will probably end up using react-broadcast as you are suggesting, but since a new version of react-context is comming up most likely all libraries will need an upgrade.

I will send a PR with my current stuffs as of now, as I made it work with CRA and react version 16.2.

agrcrobles avatar Dec 09 '17 23:12 agrcrobles