-
Notifications
You must be signed in to change notification settings - Fork 18
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
Thanks and ES6+ question #1
Comments
Are you using the ES7 decorator syntax? Also, how do you export the module? I think that is important. Maybe paste in a full component and i'll see if I can identify any problems. It's been awhile since i've used |
Well it would be something like this... It doesn't use any ES7 decorators because I was only compiling ES5 and 6. The errors in the browser are:
I definitely got it to work exactly how you did it with ES7, but I just want to know why it breaks in anything outside of ES7. I am using browserify. Index.js
Tree.js
Item.js
|
from Tree.js
could that be why? |
For continuity sake, I changed the code back to the original example. For this it should be var Tree = React.createClass({ |
Oh damn, and I thought it would be easy. I'll try to implement the example this way and see what I get. |
I made a fork for an ES6 version. @tamagokun - thanks for the awesome example! You rock. https://github.com/jotty-mcclure/example-react-dnd-nested Also, let me know if I can add this as an ES6 branch to your repo. |
#8 should fix this once it lands 🙌 |
Thanks for this nested set up with React DnD! I got your example running on localhost and have also got it working inside my application code.
I do have one question though. I was using the ES5 way of creating a react class...namely:
And noticed that it just wouldn't work. The browser was giving me a ton of errors. It seems as though I need to cut to ES6/7 techniques cold-turkey in order for this to work. Is there a simple answer to why? I am just starting to convert my code to ES6 starting this week so I'm not too familiar.
My guess is it has something to do with the class declaration and inheritance. Or just simply being able to call the same Tree component inside of a child component and having it actually be "NEW".
The text was updated successfully, but these errors were encountered: