I had trouble to get ref working on one of my composite components.
This inline ref function
<MyComp ref={element => this.listElement = element}/>
will always be called with element===null on mount and unmount the like. Thats because MyComp is a stateless/functional component.
react should print a warning if one tries to use ref with stateless components.
I had trouble to get
refworking on one of my composite components.This inline ref function
<MyComp ref={element => this.listElement = element}/>will always be called with
element===nullon mount and unmount the like. Thats becauseMyCompis a stateless/functional component.react should print a warning if one tries to use
refwith stateless components.