Skip to content
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

Element ref was specified as a string (inner) but no owner was set. This could happen for one of the following reasons: #968

Closed
worapolburaphan opened this issue Aug 24, 2018 · 2 comments · Fixed by #1282

Comments

@worapolburaphan
Copy link

!!! Important info
I using Next.js 6 (React SSR Library)
Node.js version 10.x.x

Do you want to request a feature or report a bug?

I'm report a bug

What's the current behavior?

When I write Calendar Component in to render method and save it, On the browser give me error below.

Invariant Violation: Element ref was specified as a string (inner) but no owner was set. This could happen for one of the following reasons:
1. You may be adding a ref to a functional 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.

react error ref

What's the expected behavior?

I want it work on next.js

Solution that i tried already

  1. npm ls react && yarn list react and it show only one react version
  2. remove node_module folder and reinstall every module by npm install
@jquense
Copy link
Owner

jquense commented Aug 24, 2018

You have multiple copies of React or react-dom. There is no other way for the library to cause this issue, and isn't anything we can do about it unfortunately. yarn and npm often don't actually report multiple copies of react, you may have to do a manual inspection.

@jquense jquense closed this as completed Aug 24, 2018
@telnet2
Copy link

telnet2 commented Dec 13, 2018

It happened to me when I used react-big-calendar with yarn link react-big-calendar. With yarn link, it automatically created node_modules/react, which doesn't exist when yarn add react-big-calendar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants