React Native: Create Reference to Component

Static Component

No reference usable

var Com = <MyComponent/>;
// Can't access members inside Com

return (
    {Com}
);

Component

With usable reference

var Com = React.createRef();
// Access members of Com thru: Com.current.*

return (
    <MyComponent ref={Com}/>
);

You'll only receive email when they publish something new.

More from 19411
All posts