Skip to content
Discussion options

You must be logged in to vote

I figured it out after a bit of digging.
If anyone needs this, I think it is an OK solution.
I have overridden the default onClick supplied by row.getToggleRowExpandedProps() and close all subComponents before opening a new one.

  /**
   * Inserts the expander
   * if there is a SubComponent
   */
  useEffect(() => {
    if (SubComponent && !colIds.includes('expander')) {
      columnsRef.current = [{
        Header: '',
        id: 'expander',
        resizable: false,
        className: classes.tdCenter,
        minWidth: 10,
        maxWidth: 10,
        width: 10,
        Cell: ({ row }: {row: Row}) => (
          <button
            {...row.getToggleRowExpandedProps()}
            ti…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by OmarOmeiri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant