The ref attribute makes it possible to store a reference to a particular React element or component returned by the component render() configuration function. This can be valuable when you need a reference, from within a component, to some element or component contained within the render() function. -

What are refs and are string refs are bad?

React 16.3 How does React.createRef work?

// use ref to easily add autofocus

class Input extends Component {
  focus() {

  render() {
    return (
        ref={el=> { this.el = el; }}