JakeSidSmith / react-reorder

Drag & drop, touch enabled, reorderable / sortable list, React component
https://jakesidsmith.github.io/react-reorder/
MIT License
218 stars 58 forks source link

Support React v16 #94

Closed viztor closed 6 years ago

viztor commented 6 years ago

Now with React v16 it will throw exception createClass not a function.

JakeSidSmith commented 6 years ago

@viztor this lib uses the create-react-class module, which should still be compatible with React 16.

If not, I will be re-writing v3 in ES6 / TypeScript, and so will using actual classes.

dargue3 commented 6 years ago

+1

I don't believe this works with React 16, unless you're saying we need to include create-react-class in our dependencies?

JakeSidSmith commented 6 years ago

It is a dep of react-reorder: https://github.com/JakeSidSmith/react-reorder/blob/master/package.json#L34

Can someone explain what exactly is the issue with React 16? :)

AntCrick commented 6 years ago

+1 Though I think it could be an issue with the version that is on npm as i used npm install to install this and it's installed react-reorder@3.0.0-alpha.4 and the react-reorder package.json doesn't have create-react-class in the dependencies that i can see so could be that maybe?

JakeSidSmith commented 6 years ago

Ah, that's it! Thanks @AntCrick will update now and publish a new alpha version.

JakeSidSmith commented 6 years ago

@AntCrick @dargue3 @viztor have published a fix at 3.0.0-alpha.5.

Please try this out, and if your issue is fixed, then close this issue. 🙂

birdy90 commented 6 years ago

I get Uncaught TypeError: Cannot read property 'oneOfType' of undefined because of

   ...
   var PropTypes = React.PropTypes;
   Reorder.propTypes = {
      component: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
   ...

And as it's said here https://reactjs.org/docs/typechecking-with-proptypes.html it is deprecated and moved to some package. What should I do to handle this problem?

JakeSidSmith commented 6 years ago

Ah, poop. So many changes to make. Will try to get this sorted shortly.

birdy90 commented 6 years ago

Maybe it will help: there's recommendations for migrating

JakeSidSmith commented 6 years ago

@birdy90 published some fixes at 3.0.0-alpha.6.

JakeSidSmith commented 6 years ago

@AntCrick @dargue3 @viztor should now work nicely with React 16.