👷‍♂️Add custom Trans component (#681)

This commit is contained in:
Luke Vella 2023-04-26 15:18:35 +01:00 committed by GitHub
parent 91bb5b8a73
commit ffbf920dbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 28 deletions

View file

@ -0,0 +1,8 @@
import { Trans as BaseTrans, useTranslation } from "next-i18next";
type TransWithContextProps = Omit<React.ComponentProps<typeof BaseTrans>, "t">;
export const Trans = (props: TransWithContextProps) => {
const { t } = useTranslation();
return <BaseTrans t={t} {...props} />;
};