I am getting error:
Parsing error: Expression expected
Here is my code base:
export interface TableRow {
rowKey: string;
rowCells: {[key: string]: any};
rowExpanded?: React.ReactNode;
}
class MvSortTable extends React.Component<Props, State> {
...
toggleAllRows = () => {
const shouldExpand = this.allRowsCollapsed(this.state.expandedRows);
const expandedRows: {[key: string]: boolean} = {};
this.props.rows?.forEach((row) => {
expandedRows[row.rowKey] = shouldExpand;
});
this.setState({ expandedRows, allRowsCollapsed: !shouldExpand });
}
...
Error come from when I add ?
into this.props.rows...
How can I fix this error?????