question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Component have ref, storybook will have error

See original GitHub issue

my component render function has return many input with ref, when I run npm run storybook, the error will throw

Uncaught Invariant Violation: removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).

what should I do?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
arunodacommented, Aug 31, 2016

This is usually means two versions of React running here. Could you send us a sample repo?

0reactions
nx-cloud[bot]commented, Apr 27, 2021

Nx Cloud Report

CI ran the following commands for commit c1a5e8981625f34c27045e07bb72112c7fdbd661. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React ref as string throw an error · Issue #3424
So ref as string is working in storybook, but it is not 2 different versions of React who create the problem. It is...
Read more >
addComponentAsRefTo error when using component from ...
I do a nmp link in the storybook in order to use it in my project. I can see the component, but it...
Read more >
Frequently Asked Questions - Storybook - JS.ORG
Here are some answers to frequently asked questions. If you have a question, you can ask it by opening an issue on the...
Read more >
Invalid Hook Call Warning
You are probably here because you got the following error message: Hooks can only be called inside the body of a function component....
Read more >
Next-level component showcasing with Storybook controls
As you can see, the Headline component just has a color prop of type string as input. To get the color picker control...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found