title: unable to create ref in react-native
body: <p>I want to set focus on next <code>TextInput</code> using <code>createRef()</code>. I am getting error in <code>createRef()</code>. What am I doing wrong? Thanks in advance.</p>
  
  <pre><code>constructor(props) {
          super(props);
              this.r2Ref = React.createRef();
              this.r3Ref = React.createRef();
              this.r4Ref = React.createRef();
              this.r5Ref = React.createRef();
      }
  
  render() {
          return (
              &lt;View style={SetStyle.settingsCont}&gt;
              &lt;ScrollView&gt;
  
                  &lt;View style={SetStyle.contRate}&gt;
  
                      &lt;View style={SetStyle.rView}&gt;
                          &lt;Text style={SetStyle.rText}&gt;Rate1&lt;/Text&gt;
                          &lt;TextInput style={SetStyle.rInput} keyboardType='numeric'
                              returnKeyType="next" onSubmitEditing={() =&gt; this.refs.r2Ref.focus()}&gt;&lt;/TextInput&gt;
                      &lt;/View&gt;
                      &lt;View style={SetStyle.rView}&gt;
                          &lt;Text style={SetStyle.rText}&gt;Rate2&lt;/Text&gt;
                          &lt;TextInput style={SetStyle.rInput} keyboardType='numeric'
                              ref={r2Ref =&gt; this.r2Ref = r2Ref}
                              returnKeyType="next" onSubimitEditing={() =&gt; this.refs.r3Ref.focus()}&gt;&lt;/TextInput&gt;
                      &lt;/View&gt;
                      &lt;View style={SetStyle.rView}&gt;
                          &lt;Text style={SetStyle.rText}&gt;Rate3&lt;/Text&gt;
                          &lt;TextInput style={SetStyle.rInput} keyboardType='numeric'
                          ref={r3Ref =&gt; this.r3Ref = r3Ref}
                          returnKeyType="next" onSubmitEditing={() =&gt; this.refs.r4Ref.focus()}&gt;&lt;/TextInput&gt;
                      &lt;/View&gt;
                      &lt;View style={SetStyle.rView}&gt;
                          &lt;Text style={SetStyle.rText}&gt;Rate4&lt;/Text&gt;
                          &lt;TextInput style={SetStyle.rInput} keyboardType='numeric'
                              ref={r4Ref =&gt; this.r4Ref = r4Ref}
                              returnKeyType="next" onSubmitEditing={() =&gt; this.refs.r5Ref.focus()}&gt;&lt;/TextInput&gt;
                      &lt;/View&gt;
                      &lt;View style={SetStyle.rView}&gt;
                          &lt;Text style={SetStyle.rText}&gt;Rate5&lt;/Text&gt;
                          &lt;TextInput style={SetStyle.rInput} keyboardType='numeric'
                              ref={r5Ref =&gt; this.r5Ref = r5Ref}&gt;&lt;/TextInput&gt;
                      &lt;/View&gt;
                  &lt;/View&gt;
  
              &lt;/ScrollView&gt;
              &lt;/View&gt;
          );
      }
  }
  </code></pre>
  
  <p>I am getting following error :</p>
  
  <blockquote>
    <p>Undefined is not an object (evaluating this2.refs.r2Refs.focus)</p>
  </blockquote>