TFunction is declared locally but not exported
See original GitHub issue🐛 Bug Report
In version < 12.0.0 the react-i18next
lib exported a TFunction
.
To Reproduce
Import the TFunction
in version 12.0.0
import { TFunction } from "react-i18next";
Expected behavior
I would like to type a parameter as a TFunction
which was imported from react-i18next
import { TFunction } from "react-i18next";
type Generator = (
client: Client,
t: TFunction<"common">,
) => Promise<{ title: string; link: string }>;
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
module declares component locally, but it is not exported
You need not import AddtimeComponent in the main module. You have to export it in SharedModule like below.
Read more >Module '"react-i18next"' declares 'TFunction' locally, but it is ...
When importing the TFunction, it has worked previously as it's been exported: import { TFunction } from 'react-i18next';. However, that's no longer the...
Read more >Documentation - Modules - TypeScript
Any declaration (such as a variable, function, class, type alias, or interface) ... A re-export does not import it locally, or introduce a...
Read more >Testing Non-Exported Functions in JavaScript - Samantha Ming
To test exported function, you can simply import it. But what about non-exported functions? Well that's easy too, thanks to Rewire!
Read more >Chapter 5 Modules - Haskell.org
If the export list is omitted, all values, types and classes defined in the module are exported, but not those that are imported....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Awesome. It works. Many thanks for your great work. 🎖️
Hey @albohlabs, we just moved the types to
i18next
. In order to havei18next
andreact-i18next
fully type-safe, just follow the instructions here https://www.i18next.com/overview/typescript. In short, you just need to change thedeclare module "react-i18next"
line todeclare module "i18next"