T
TanStack3y ago
sensitive-blue

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,
},
{
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()
const { t } = useTranslation()
Thank you
1 Reply
optimistic-gold
optimistic-gold3y ago
i have same issue if theres solution

Did you find this page helpful?