The correct code.
JsFiddle work: http://jsfiddle.net/reactjs/69z2wepo/
var App = React.createClass({ render: function() { return ( <h1 ref="myRef">This is a test</h1> ); } }); React.render( <App />, document.body );
According to the error message, you place a link to an item that does not belong to you, but in the code that you specified, h1
belongs to the App
. Is your code different from what you pasted above?
Note ( from documents ):
In React, an owner is the component that sets the props of other components ... It important to draw a distinction between the owner-ownee relationship and the parent-child relationship.
source share