title: Mui Modal closing on Dispatching action in the Parent Component
body: <p>I have created a modal component that opens onClick. This component uses a callback from it's parent component that dispatches an action from it's parent component.
  The modal has a state variable called &quot;open&quot; which is used to decide whether to open the modal or not.</p>
  <pre><code>const handleOpen = () =&gt; {
  props.getDetails(props.dsaId?props.dsaId:props.triggerName)
  setOpen(open) 
  </code></pre>
  <p>};</p>
  <p>The handleOpen function is called when the button is clicked.
  As you can see setOpen changes [open] value  to true , which in turn should open the Modal.</p>
  <pre><code>    props.getDetails(props.dsaId?props.dsaId:props.triggerName)
  </code></pre>
  <p>is used for dispatching an action in the parent component, which in turn will pass the data as props to my child component.</p>
  <p>The problem is when i call the callback function from the child component, action dispatched in the parent component causes the parent to rerender , which in turn re-renders the child component setting [open] to false again, which closes the modal.</p>
  <p>How do i Keep the modal open , after dispatching the action.</p>