Skip to content
Permalink
Browse files

Update syntax in examples (#1631)

  • Loading branch information...
dcchuck authored and tannerlinsley committed Nov 5, 2019
1 parent 0e92ec2 commit 9698677982f1d793d5b0e32ae7849dc41d54d0c4
@@ -93,16 +93,17 @@ function Table({ columns, data }) {

<div className="rows" {...getTableBodyProps()}>
{rows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<div {...row.getRowProps()} className="row body">
{row.cells.map((cell,index) => (
<div {...cell.getCellProps()} key={index} className="cell">
{cell.render('Cell')}
</div>
))}
</div>
)
)}
)}
</div>
</div>
@@ -268,8 +268,9 @@ function Table({ columns, data }) {
<tbody {...getTableBodyProps()}>
<AnimatePresence>
{rows.slice(0, 10).map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<motion.tr
{...row.getRowProps({
layoutTransition: spring,
@@ -288,7 +289,7 @@ function Table({ columns, data }) {
)
})}
</motion.tr>
)
)}
)}
</AnimatePresence>
</tbody>
@@ -60,14 +60,15 @@ function Table({ columns, data }) {
</thead>
<tbody {...getTableBodyProps()}>
{rows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return <td {...cell.getCellProps()}>{cell.render('Cell')}</td>
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -76,8 +76,9 @@ function Table({ columns, data }) {

<div {...getTableBodyProps()}>
{rows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<div {...row.getRowProps()} className="tr">
{row.cells.map(cell => {
return (
@@ -87,7 +88,7 @@ function Table({ columns, data }) {
)
})}
</div>
)
)}
)}
</div>
</div>
@@ -81,16 +81,17 @@ function Table({ columns, data }) {
</thead>
<tbody {...getTableBodyProps()}>
{rows.slice(0, 10).map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map((cell, i) => {
return (
<td {...cell.getCellProps()}>{cell.render('Cell')}</td>
)
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -103,8 +103,9 @@ function Table({ columns, data }) {

<div {...getTableBodyProps()}>
{rows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<div {...row.getRowProps()} className="tr">
{row.cells.map(cell => {
return (
@@ -114,7 +115,7 @@ function Table({ columns, data }) {
)
})}
</div>
)
)}
)}
</div>
</div>
@@ -127,16 +127,17 @@ function Table({ columns, data, updateMyData, disablePageResetOnDataChange }) {
</thead>
<tbody {...getTableBodyProps()}>
{page.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return (
<td {...cell.getCellProps()}>{cell.render('Cell')}</td>
)
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -63,16 +63,17 @@ function Table({ columns: userColumns, data }) {
</thead>
<tbody {...getTableBodyProps()}>
{rows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return (
<td {...cell.getCellProps()}>{cell.render('Cell')}</td>
)
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -254,16 +254,17 @@ function Table({ columns, data }) {
</thead>
<tbody {...getTableBodyProps()}>
{firstPageRows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return (
<td {...cell.getCellProps()}>{cell.render('Cell')}</td>
)
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -80,8 +80,9 @@ function Table({ columns, data }) {
</thead>
<tbody {...getTableBodyProps()}>
{firstPageRows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return (
@@ -120,7 +121,7 @@ function Table({ columns, data }) {
)
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -351,8 +351,9 @@ function Table({ columns, data, updateMyData, disablePageResetOnDataChange }) {
</thead>
<tbody {...getTableBodyProps()}>
{page.map(
row =>
prepareRow(row) || (
row => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return (
@@ -378,7 +379,7 @@ function Table({ columns, data, updateMyData, disablePageResetOnDataChange }) {
)
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -351,8 +351,9 @@ function Table({ columns, data, updateMyData, disablePageResetOnDataChange }) {
</thead>
<tbody {...getTableBodyProps()}>
{page.map(
row =>
prepareRow(row) || (
row => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return (
@@ -378,7 +379,7 @@ function Table({ columns, data, updateMyData, disablePageResetOnDataChange }) {
)
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -40,8 +40,9 @@ function Table({ columns, data }) {
</TableHead>
<TableBody>
{rows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<TableRow {...row.getRowProps()}>
{row.cells.map(cell => {
return (
@@ -51,7 +52,7 @@ function Table({ columns, data }) {
)
})}
</TableRow>
)
)}
)}
</TableBody>
</MaUTable>
@@ -116,16 +116,17 @@ function Table({
</thead>
<tbody {...getTableBodyProps()}>
{page.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return (
<td {...cell.getCellProps()}>{cell.render("Cell")}</td>
);
})}
</tr>
)
)}
)}
<tr>
{loading ? (
@@ -96,16 +96,17 @@ function Table({ columns, data }) {
</thead>
<tbody {...getTableBodyProps()}>
{page.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return (
<td {...cell.getCellProps()}>{cell.render('Cell')}</td>
)
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -66,16 +66,17 @@ function Table({ columns, data }) {
</thead>
<tbody {...getTableBodyProps()}>
{rows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return (
<td {...cell.getCellProps()}>{cell.render('Cell')}</td>
)
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -45,14 +45,15 @@ function MyTable() {
</thead>
<tbody {...getTableBodyProps()}>
{rows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return <td {...cell.getCellProps()}>{cell.render('Cell')}</td>
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -78,16 +78,17 @@ function Table({ columns, data }) {
</thead>
<tbody {...getTableBodyProps()}>
{firstPageRows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map(cell => {
return (
<td {...cell.getCellProps()}>{cell.render('Cell')}</td>
)
})}
</tr>
)
)}
)}
</tbody>
</table>
@@ -71,8 +71,9 @@ function Table({ columns: userColumns, data, renderRowSubComponent }) {
</thead>
<tbody {...getTableBodyProps()}>
{rows.map(
(row, i) =>
prepareRow(row) || (
(row, i) => {
prepareRow(row);
return (
// Use a React.Fragment here so the table markup is still valid
<>
<tr {...row.getRowProps()}>
@@ -101,7 +102,7 @@ function Table({ columns: userColumns, data, renderRowSubComponent }) {
</tr>
) : null}
</>
)
)}
)}
</tbody>
</table>

0 comments on commit 9698677

Please sign in to comment.
You can’t perform that action at this time.