66
rated 0 times
[
69]
[
3]
/ answers: 1 / hits: 23619
/ 8 Years ago, tue, september 27, 2016, 12:00:00
I want to get a ref to the component represented by the element i create, but cannot get it to work. I tried this:
var comp = React.createElement(
MyComp,
{
props: myprops,
ref: mycomp
}
);
But this doesn't work. How do i set a ref on it so the parent can call this.refs.mycomp.someMethod()
?
More From » reactjs