Reputation: 11
./src/components/common/tableBody.jsx Line 11:11: Expected an assignment or function call and instead saw an expression no-unused-expressions
Search for the keywords to learn more about each error.
Here is the code:
import React, { Component } from "react";
import _ from "lodash";
class TableBody extends Component {
render() {
const { data, columns } = this.props;
return (
<tbody>
{data.map((item) => (
<tr>
{columns.map((column) => (
<td>{_.get(item, column.path)}</td>
))}
</tr>
))}
</tbody>
);
}
}
export default TableBody;
Upvotes: 0
Views: 58
Reputation: 385
{data.map((item) => {
return(
<td>{_.get(item, columns.path)}</td>
)
})}
The lack of return is the probable cause of this error
Upvotes: 1