Hi Team,
Thanks for reading my comment.. I am trying to add React router on cells and this is not working.
Can you please check what i am missing...
const data = {
rows: salesusers,
columns: [
{
label: 'Name',
sort: 'asc',
ignoreRowClick: true,
render: ({ rows }) => (< Link to="/foo/${rows.id}">Edit Link>)
},
{
label: 'Mobile',
field: 'mobile',
sort: 'asc'
}
]
};
Can you please help me to find out what i am missing. Thanks Again
render: ({ rows }) => (< Link to="/foo/${rows.id}">Edit Link>)
Use Cell not render. ...for exact signature details check https://github.com/tannerlinsley/react-table/blob/master/docs/api.md#usetable at Cell: Function | React.Component => JSX section
You can use the Cell property to render whatever you'd like. You can also reference info.row.original if you need more data from the original row:
const columsn = [{
accessor: 'firstName',
Cell: ({ cell: { value }, row: { original } }) => <Link to={`users/${original.id}`}>{value}</Link>
}]
Most helpful comment
You can use the
Cellproperty to render whatever you'd like. You can also referenceinfo.row.originalif you need more data from the original row: