title: react native: attempted to assign to readonly property
body: <p>I create a React ref by calling React.createRef in React Native. Then I  assign it to a ref. I got the error: Attempted to assign to readonly property</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export default class List extends PureComponent&lt;Props, object&gt; {
  
    private flatListRef: React.RefObject&lt;FlatList&lt;any&gt;&gt;;
  
    constructor(props) {
      super(props);
      this.flatListRef = React.createRef();
    }
    render() {
      return (
        /.../
        &lt;FlatList ref={this.flatListRef}&gt;&lt;/FlatList&gt;
      )
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>But When I use the callback way to assign the react ref, everything is ok.</p>
  
  <pre><code>&lt;FlatList ref={ele =&gt; { this.flatListRef = ele }}&gt;&lt;/FlatList&gt;
  </code></pre>
  
  <p>I have no idea what's the difference between the two ways </p>