title: Attempted to assign to readonly property in React Native component
body: <p>I have the following (simplified) class:</p>
  
  <pre><code>export default class MyComponent extends Component {
      constructor(props) {
          super(props);
  
          this.state = {
              result: null,
          }
  
          // Input values
          this.wg = null;
  
          // Reset error flags
          this.resetErrors();
      }
  
      resetErrors() {
          this.wg_error = false;
      }
  
  
      inputErrorFound() {
          return this.wg_error;
      }
  
      calculate() {
          // Check input values
          if (this.wg == null) {
              this.wg_error = true;
          }
  
          if (this.inputErrorFound()) {
              alert("Do something here");
          } else {
              //More stuff..
          }
      }
  }
  </code></pre>
  
  <p>I'm getting an "Attempted to assign to readonly property" error on the line with <code>this.wg_error = true;</code>. Can someone explain why this is, and how to fix it? Thank you!</p>