title: Set Modal isOpen on props condition React js
body: <p>I have Modal in React Js which is working fine on  button click</p>
  <p>Here is Modal</p>
  <pre><code>   &lt;Modal isOpen={modalIsOpen} onRequestClose={()=&gt;setmodalIsOpen(false)}&gt;
  </code></pre>
  <p>Here is Button on which click it is working</p>
  <pre><code> &lt;button onClick={()=&gt;{setmodalIsOpen(true)}}&gt;Open modal&lt;/button&gt;    
  </code></pre>
  <p>Here is my function or hook</p>
  <pre><code>const [modalIsOpen, setmodalIsOpen] = useState(false)
  </code></pre>
  <p>That is quite simple as  you can see but the task is -&gt; with this working as weel
  i want to open modal with a prop value which will be bollean(TRUE) .</p>
  <p>Here is my prop</p>
  <pre><code>props.modalIsOpen
  </code></pre>
  <p>Its is containing the true value i have checked with console.</p>
  <p>Now the question is where should i put condition to check
  If there is true value in props please open the modal.
  Else its working should be with hooks.</p>
  <p>What i tried is</p>
  <pre><code>if(props.modalIsOpen){
      setmodalIsOpen(true)
  
    }
  </code></pre>
  <p>i know this is funny because it completely blanks my page. so i know this condition is now correct.
  One more thing i am using function here on Modal page and class on the page from where props coming from.</p>