michelson / dante2

A complete rewrite of dante editor in draft-js
https://michelson.github.io/dante2/
Other
912 stars 121 forks source link

Anyone running this with CRA - 16.9+? #211

Closed samuelcelko closed 4 years ago

samuelcelko commented 4 years ago

Hi there, thank you for this project, it's truly awesome. I'm wondering whether there's someone successfully running CRA 16.9+ and utilising this library. Upon trying to use the <Dante/> component I'm left with the following error:

`Error: Element ref was specified as a string (editor) but no owner was set. This could happen for one of the following reasons:
1. You may be adding a ref to a function component
2. You may be adding a ref to a component that was not created inside a component's render method
3. You have multiple copies of React loaded
See https://fb.me/react-refs-must-have-owner for more information.`

Any help is appreciated and again thanks for this great library.

ghost commented 4 years ago

I tried to make it work with react@experimental but it doesn't. Facing same issues.

michelson commented 4 years ago

you need to dedupe react dependences, see bullet 3. you have multiple copies of react loaded. usually this is solve by resolve alias of react on webpack config

something like:

     ....
     resolve: {
      alias: {
        react: path.resolve('./node_modules/react'),
     }
    ....
}
fabdrol commented 4 years ago

@michelson I'm seeing this error, but using Typescript (tsc). How do I handle this? Seems like an odd bug.

kishan-tocca commented 4 years ago

@michelson I'm seeing this error, but using Typescript (tsc). How do I handle this? Seems like an odd bug.

facing same issue

alxAgu commented 3 years ago

Same here. Why was this even closed?

@fabdrol, did you manage to solve it?