You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
I'm using @tanstack/react-table": "^8.5.30
Inside my DataTable component, I need to figure out whether the cell function passed to the columnDef or not!
Because I want to use a different class name if the cell function is passed to the columnDef.
I know it's the wrong way, but I had to fix it temporarily like this:
How can I get rid of this part of the code: cell.column.columnDef.cell?.toString().includes('context') ? 'custom-cell-content' : 'cell-content'
Is there any option to check if the cell function is passed?
I mean like this: cell.column.columnDef.isCustomCell ? 'custom-cell-content' : 'cell-content'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I'm using
@tanstack/react-table": "^8.5.30
Inside my DataTable component, I need to figure out whether the cell function passed to the columnDef or not!
Because I want to use a different class name if the cell function is passed to the columnDef.
I know it's the wrong way, but I had to fix it temporarily like this:
components/DataTable.tsx
And my columnDef is like this:
pages/users.tsx
How can I get rid of this part of the code:
cell.column.columnDef.cell?.toString().includes('context') ? 'custom-cell-content' : 'cell-content'
Is there any option to check if the cell function is passed?
I mean like this:
cell.column.columnDef.isCustomCell ? 'custom-cell-content' : 'cell-content'
Thank you in advance :)
Beta Was this translation helpful? Give feedback.
All reactions