beizhedenglong / reactablejs

A react high-order component for interact.js(drag and drop, resizing and multi-touch gestures).
https://beizhedenglong.github.io/reactablejs/
MIT License
64 stars 8 forks source link

Newbie: Can't get reactable to work #2

Closed eliasericsson closed 5 years ago

eliasericsson commented 5 years ago

I'm new to React and I can't manage to get reactablejs to work, here is my attempt at implementing the example code: https://github.com/eliasericsson/reactable-example

This is the error I'm getting: ./node_modules/reactablejs/dist/index.mjs Can't import the named export 'Component' from non EcmaScript module (only default export is available)

I apologize if I've missed something fundamental.

beizhedenglong commented 5 years ago

It seems that create react app doesn't support ECMAScript Modules. I published a new version(0.1.3) to npm. Upgrade your reactablejs dependency to 0.1.3. Your App.js was written by typescript syntax. If you want use reactablejs is Javascript, there is a JS version example

eliasericsson commented 5 years ago

I've now updated to 0.1.3 and it works fine! Thank you very much!

I gather from checking out some other React projects that App.js and App.tsx are interchangable, but the syntax varies a little bit? If there any benefit to using one over the other with reactablejs?

beizhedenglong commented 5 years ago

yes, their syntax is different, typescript file just offer some type information. Typescript and Javascript all work fine with reactablejs.