TanStackT
TanStack3y ago
1 reply
systematic-tan

Translate header using React and I18Next

I have a react app with i18next installed.
I am using the @tanstack/react-table component.
I am creating the columns in separation from the component itself in a utility file that exports the columns for this specific table

{
            id: 'recordId',
            header: 'Record Id',
            accessorFn: (originalRow) => originalRow.recordId,
            enableHiding: false,
            size: 30,
 },


I want to translate the header into another language but I could find a way to use the hook or to pass it to the columns.
Is there any way to separate to columns from the table component and not to save it in a useMemo.
const { t } = useTranslation()


Thank you
Was this page helpful?