re-carousel icon indicating copy to clipboard operation
re-carousel copied to clipboard

Invariant Violation Error when Used in Storybook

Open ryanfitzer opened this issue 7 years ago • 3 comments

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.

ryanfitzer avatar Oct 06 '18 01:10 ryanfitzer

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)

amio avatar Oct 08 '18 03:10 amio

I’m all for it!

ryanfitzer avatar Oct 08 '18 03:10 ryanfitzer

It would increase the bundle size (2.7KB currently)

~ 7.5KB is still very minimal.

ryanfitzer avatar Oct 09 '18 01:10 ryanfitzer