You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to get the examples working in jsfiddles; to that end my understanding is that it should be possible to include the dist/react-magic-move.js script as a normal script reference, after the usual React support scripts (including the in-browser JSXTransformer).
However, my minimally-adapted version of the basic ('States') example on top of the "React Base Fiddle (JSX)" is triggering an odd React invariant error near the wrapup of the initial render: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component'srendermethod). Try rendering this component inside of a new top-level component which will hold the ref.
The component-setup code is unchanged, so any owner-setup should still work. I thought it might be a problem specific to JSFiddle's panel setup, so I tried an entirely local-files setup – same error. I'm now thinking it may be a namespace issue arising from not loading-via-require()s, or an incompatibility with in-browser JSXTransformer use. (If the problem is either of these, it might merit a dist-script fix or doc note.)
At StackOverflow, someone pointing out another case where this error occurred, where the cause was multiple-definition of React classes, and that dist/react-magic-move.js repeats definitions from the standard react.js (and/or react-with-addons.js).
Is that intentional override/redefinition, and if so what's the right way to use the 'dist' form of react-magic-move? It seems not to mix well as a simple addition, loaded afterward.
gojomo
changed the title
"Only a ReactOwner can have refs" error in JSFiddle-zed example
adding dist/react-magic-move.js after 0.13.1 react.js gives "Only a ReactOwner can have refs" error
Mar 27, 2015
I'd like to get the examples working in jsfiddles; to that end my understanding is that it should be possible to include the dist/react-magic-move.js script as a normal script reference, after the usual React support scripts (including the in-browser JSXTransformer).
However, my minimally-adapted version of the basic ('States') example on top of the "React Base Fiddle (JSX)" is triggering an odd React invariant error near the wrapup of the initial render:
Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's
rendermethod). Try rendering this component inside of a new top-level component which will hold the ref.
The component-setup code is unchanged, so any owner-setup should still work. I thought it might be a problem specific to JSFiddle's panel setup, so I tried an entirely local-files setup – same error. I'm now thinking it may be a namespace issue arising from not loading-via-require()s, or an incompatibility with in-browser JSXTransformer use. (If the problem is either of these, it might merit a dist-script fix or doc note.)
You can view the error-triggering setup at: http://jsfiddle.net/69z2wepo/4692/
Any ideas?
The text was updated successfully, but these errors were encountered: