title: React Typescript: SetState inside React.FC to change value in React.Component
body: <p>I have an <code>React.Component</code> with an state <code>modalVisible</code> to open an Modal:</p>
  <pre><code>&lt;Modal
     visible={this.state.modalVisible}
  &gt;
     &lt;FormStructure
        record={this.state.selectedRecord}
        question={this.state.question}
        dropdownItems={this.state.dropdownItems}
     /&gt;
  &lt;/Modal&gt;
  </code></pre>
  <p>After the <code>Modal</code> opens the <code>React.FC</code> <code>&lt;FormStrucutre ... /&gt;</code> gets rendered and the Problem is that I dont know how to change the state value <code>modalVisible</code> inside the <code>React.FC</code>:</p>
  <pre><code> const Submit = () =&gt; {
          fetch('api/Call/Save', {
              headers: { 'Content-Type': 'application/json' },
              method: 'POST',
              body: JSON.stringify({
                  'No': form.getFieldValue('no')
              })
          })
              .then(() =&gt; this.setState({modalVisible: false}); //TS2532  (TS) Object is possibly 'undefined'.
      };
  </code></pre>