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.

Error: Invariant Violation: addComponentAsRefTo

See original GitHub issue

Seeing this error in the latest 0.6.1:

Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded 

Anyone else having this issue?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:15

github_iconTop GitHub Comments

3reactions
djbobbydrakecommented, Nov 16, 2015

Yup @antoinerey that worked for me. Closing this issue.

1reaction
ophitecommented, Feb 14, 2018

This error with: 15.6.2 -react, 3.1.13 - react- modal

Read more comments on GitHub >

github_iconTop Results From Across the Web

addComponentAsRefTo(...): Only a ReactOwner can have refs ...
Uncaught Error: Invariant Violation: addComponentAsRefTo(. ... I'm getting the same error, with no indication that I'm loading React more ...
Read more >
React ref not working Invariant Violation - Stack Overflow
Below is the error message. invariant.js:39Uncaught Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs.
Read more >
Fixing the Jest Error, "Invariant Violation
Jest sometimes fails with an error, "Invariant Violation: addComponentAsRefTo". This how-to discusses a solution for the error & speculates ...
Read more >
`Error: Invariant Violation: addComponentAsRefTo(...): Only a ...
Coding example for the question Testing: `Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs.` error-Reactjs.
Read more >
Refs Must Have Owner Warning - React
addComponentAsRefTo (…): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a...
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