title: React Table using hooks expand and collapse rows
body: <p>I am using react-table component inside my project. The row expansion property is something that my features utilized and it is working fine now.</p>
  
  <p>I need the ability to collapse all the rows while I expand a row. ie Only one row should be open at a time. I did go through many documentation and stackoverflow links but none didn't work out. Please note that this implementation is using hooks. Just like the one mentioned here : <a href="https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/expanding" rel="nofollow noreferrer">https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/expanding</a></p>
  
  <p>By default they allow to open more than one row at a time, but I need to implement the opposite.</p>
  
  <p>The closest I came to is this : <a href="https://stackoverflow.com/questions/60074500/auto-expandable-rows-and-subrows-react-table-using-hooks">Auto expandable rows and subrows react table using hooks</a></p>
  
  <p>But here its opening on initial load. </p>
  
  <p>Thanks</p>