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

Invariant Violation Error when Used in Storybook #110

Open
ryanfitzer opened this issue Oct 6, 2018 · 3 comments
Open

Invariant Violation Error when Used in Storybook #110

ryanfitzer opened this issue Oct 6, 2018 · 3 comments

Comments

@ryanfitzer
Copy link

When trying to use this component in Storybook, I get the following error:

Element ref was specified as a string (wrapper) 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.

Invariant Violation: Element ref was specified as a string (wrapper) 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.

Looks like it's due to using string refs.

@amio
Copy link
Owner

amio commented Oct 8, 2018

We should update the usage of ref in favor of React 16.

Even further, I'm thinking remove those refs, using react-motion (4.8KB) for animation. It would increase the bundle size (2.7KB currently), but in return we get:

  • Simpler animation code & better suit React 16
  • Support React Native (big bonus)

@ryanfitzer
Copy link
Author

I’m all for it!

@ryanfitzer
Copy link
Author

It would increase the bundle size (2.7KB currently)

~ 7.5KB is still very minimal.

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

No branches or pull requests

2 participants