How to use the react-table.ReactTableDefaults.ExpanderComponent function in react-table

To help you get started, we’ve selected a few react-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github glin / reactable / srcjs / columns.js View on Github external
if (React.isValidElement(value)) {
        content = value
      } else if (col.html) {
        // Render inline to align with the expander
        content = <div value="" style="{{">
      } else {
        content = value != null ? String(value) : ''
      }

      // Render expander for custom row details
      let expander
      if (col.details) {
        if (col.details instanceof Array &amp;&amp; col.details[cellInfo.index] == null) {
          // Don't expand rows without content
        } else {
          expander = ReactTableDefaults.ExpanderComponent({
            ...cellInfo,
            isExpanded: isExpanded(cellInfo)
          })
        }
      }

      if (expander) {
        return (
          
            {expander}
            {content}
          
        )
      }
      return content
    }</div>