Return XML as well call a JavaScript function using ternary operator in React.js
<p>I am using a ternary operator in JSX to generate some components according to some state set by the User's choice. What I want to do is to also call a JavaScript function or some statement along with generating the components.</p>

<p>This is my related code: </p>

<pre><code>          {
            this.state.isTextEditor === 'yes'
              ?
            &lt;Row&gt;
              &lt;Col sm={12}&gt;
                &lt;TextEditor placeholder="Job description here"/&gt;
              &lt;/Col&gt;
            &lt;/Row&gt;
              :
            &lt;FormGroup controlId="companySignupFormJD"&gt;
              &lt;Row&gt;
                &lt;Col sm={12}&gt;
                  &lt;SelectFile
                    ref="JD-file"
                    image={false}
                    controlId={'JD-file'}
                    supportedFiles={supportedDocs}
                    btnLabel={'Select File'}
                    helpText={'PDF, DOC DOCX or TXT'}
                    onChange={::this.setJDFile} /&gt;
                &lt;/Col&gt;
              &lt;/Row&gt;
            &lt;/FormGroup&gt;
          }
</code></pre>

<p>What I want to do is something like this:</p>

<pre><code>{
        this.state.isTextEditor === 'yes'
          ?
        &lt;Row&gt;
          &lt;Col sm={12}&gt;
            &lt;TextEditor placeholder="Job description here"/&gt;
          &lt;/Col&gt;
        &lt;/Row&gt;
          (and someGlobalVariable += 'classActive')
          :
        ...//same code as above
}
</code></pre>

<p>Any kind of help will be appreciated.</p>