React fragment should't include
See original GitHub issueHi guys. I updated my app and catch error which didn’t appear in the past.
Updated from “react-table”: “^7.0.0-rc.15”, to “react-table”: “version”: “7.0.0”
The table uses code from the table expanded example in your’s page
<tbody {...getTableBodyProps()}>
{rows.map((row, i) => {
prepareRow(row)
return (
<React.Fragment {...row.getRowProps()}>
<tr className={row.isExpanded ? styles.selectedRow : null}>
{row.cells.map((cell, index) => {
return (
<td key={index} className={cell.column.className} {...cell.getCellProps()}>{cell.render('Cell')}</td>
)
})}
</tr>
{/*
If the row is in an expanded state, render a row with a
column that fills the entire length of the table.
*/}
{row.isExpanded ? (
<tr {...row.getRowProps()}>
<td colSpan={visibleColumns.length}>
{renderRowSubComponent(row)}
</td>
</tr>
) : null}
</React.Fragment>
)
})}
</tbody>
The error I catch is
“Warning: Invalid prop role
supplied to React.Fragment
. React.Fragment can only have key
and children
props.”
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Fragments - React
A common pattern in React is for a component to return multiple elements. Fragments let you group a list of children without adding...
Read more >Understanding React fragments - LogRocket Blog
Fragments are syntax that allow us to add multiple elements to a React component without wrapping them in an extra DOM node. Let's...
Read more >React Fragments - Uses, Examples, Practices - KnowledgeHut
“ Fragments are syntax that allows us to add multiple elements to a React component without wrapping them in an extra DOM node.” ......
Read more >React Fragments – What, Why, How - DEV Community
Solution for this is, you guessed it, fragments! React fragments let you group a list of children without adding extra nodes to the...
Read more >React: Guide to Fragments - Bits and Pieces - Bit.dev
React : Guide to Fragments. This is another post in our React Series, we have learned many React concepts in our past posts...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Dear future me (and everyone struggling like me),
Another example already have dealt this issue:
or you can just fix L77 of our example appropriately.
Stay safe!
@adrenalin8231,thank you, it worked. But dont forget remove
{...row.getRowProps()}