Visual Studio Code attempts to import react-i18next as react-i18next/* when attempting to use a function.
As example here:

which does not work and causes this error in the end.

Removing the extra /* works.
npm i react-i18nextCTRL+. keystroakreact-i18next/*import { useTranslation } from "react-i18next/*";
const { t } = useTranslation();
To import the correct path.
import { useTranslation } from "react-i18next";
const { t }聽= useTranslation();
1.
https://github.com/i18next/react-i18next/blob/086246ee653b1ff7679a12dbb6b840c23f22fa0b/package.json#L7-L13
To change to:
"typesVersions": {
">=4.1": {
"*": [
"src/ts4.1/*"
]
}
},
Would fix vscode to import the correct path, but then react refuses to compile cause it can't find module.
2.
Drag items out of the ./src directory in node_modules/react-i18next/ to it's package root.
Edit package json from:
"types": "./index.d.ts",
"typesVersions": {
">=4.1": {
"*": [
"ts4.1/*"
]
}
},
This is what seemed to have 'fixed' it up for me.
I have the same issue.
Thanks @ThomasAunvik, I'll be investigating it
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hey @ThomasAunvik, TypeScript should allow our current structure, so I opened an issue for it. In the meantime, I'll open a PR to move the type definitions.
Hey @ThomasAunvik, it should be fixed by now. I'll revisit this issue again once the TypeScript team solves the issue above. Thanks for pointing that out!