title: How to use componentdidmount in modal only when i use modal?
body: <p>How to use componentdidmount in modal only when i use modal?
  If i didnt call the modal dont use component didmount in modal?</p>
  
  <pre><code>{showVacationRequestModal ?
                                  &lt;ModalVacationsRequestDetails
                                      open={showVacationRequestModal}
                                      onClose={this.hideVacationRequestModal}
                                      title={selectedVacationRequest.topic}
                                      selectedVacationRequest={selectedVacationRequest}
                                      width="md"/&gt; : null}
  componentDidMount() {
      ApiEmployees.getOrganizations(Global.getCurrentUser().employeeCode).then(items =&gt; {
          let orgs = items.map(it =&gt; {
              return {value: it.id, label: it.name};
          });
          this.setState({organizations: orgs, selectedOrganization: orgs[0].value});
          this.getEmployeeByCodeAndOrganization(items[0].id);
      });
  </code></pre>