#react-i18next declares 'TFunction' locally, but it is not exported.

1 messages · Page 1 of 1 (latest)

sterile loom
#

Hey all, does anyone have any idea why I would be getting the error: ... react-i18next declares 'TFunction' locally, but it is no exported.?

I understand the type enhancements for react-i18next moved to i18next - but this was for version [email protected] and [email protected]. (https://react.i18next.com/latest/typescript)

The background is, I am moving a hook to an npm-module, the hood relies on import { TFunction, useTranslation } from 'react-i18next'.
In the project, this import works fine.
In the npm module code, this import ... react-i18next declares ;TFunction' locally, but it is no exported.

I don't understand why it works in the project, but not in the module?
I am setting the modules to identical versions in package.json:

"i18next": "^21.8.14"
"react-i18next": "^11.18.3"
frigid marlin
#

I'd have to look at your exact dependencies to figure it out, @types/react-i18next doesn't export it

#

nor does any of the version of react-i18next export TFunction after the typings were inlined

#

I'd recommend import { TFunction } from "i18next"

#

it's possible that TFunction is globally declared if you were using the out-of-tree @types/react-i18next