ref = {(node) => (this.avatareditor = node)}

this.nodeRef = React.createRef();

...

<Comp ref={this.nodeRef}/>
Different Donkey