twisty / formsy-react-components

Bootstrap components for a formsy-react form.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Only a ReactOwner can have refs" error when using CheckboxGroup

SachaG opened this issue · comments

I just started getting Only a ReactOwner can have refs errors when using the CheckboxGroup component. What's weird is that it doesn't happen for any other component, including RadioGroup. Does CheckboxGroup do anything different that might be triggering the issue?

Here's the full error:

Uncaught 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 (details: https://fb.me/react-refs-must-have-owner).

Hi, sorry you're having problems... I don't think there's anything particularly different in CheckboxGroup over other components.

Did any of the steps on the details page referenced in the error throw any light onto this?

I've encountered a similar warning whist pulling my hair out trying to get Browserify to work. That may be an avenue for exploration?

Agreed, weird it's only for the CheckboxGroup triggering issue. Report back if you can.

So this is weird. I wanted to bring in the code for CheckboxGroup into my own codebase (it's a Meteor app btw) to help debug the issue, and as soon as I did that the problem went away. So I can't really explain it… but I guess I'll just do this for now.

Not sure what was happening, and as you have a work-around I'm going to close this. If anyone can replicate, post code and I'll have another look.