Aral Roca Gomez

Results 463 comments of Aral Roca Gomez

Well, `useTranslation` package should be imported from `next-translate/useTranslation`: ```js import useTranslation from 'next-translate/useTranslation' ``` This is deprecated: ```js import { useTranslation } from 'next-translate' ``` In fact, in the latest...

@gurkerl83 It is open to debate. I prefer that people use it as a separate package to avoid tree-shaking problems, although webpack in principle does tree-shaking I had experienced some...

@gurkerl83 as a conclusion, we can say: - [ ] Add again the type Translate - [ ] Check whether to put back the named exports To verify the tree-shaking...

@vimutti77 I saw it recently... I don't know either... The correct one is as you say: ```js import useTranslation from 'next-translate/useTranslation' ``` Because it will load ESM or CJS depending...

Asked in stackoverflow: https://stackoverflow.com/questions/65145253/how-to-tell-vscode-which-suggested-import-is-correct-for-library-creators I hope someone will enlighten me. I will still continue my research.

@gurkerl83 I did a prerelease **[1.0.0-canary.6](https://github.com/vinissimus/next-translate/releases/tag/1.0.0-canary.6)** re-adding the Translate type _(improved a little bit than 0.20.x)_. Would you confirm that it works well for you? Thank you! 🙏

@gurkerl83 feel free to PR! to be honest, I am not very familiar with TypeScript yet and I am sure it can be better.

About the named exports, after adding this to the `index.ts` file: ```js export { default as DynamicNamespaces } from './DynamicNamespaces' export { default as I18nProvider } from './I18nProvider' export {...

I added on the example https://github.com/vinissimus/next-translate/pull/379

@vimutti77 Finally, I have seen that the auto-import is related to where the TypeScript types are. **Moving the types to the root** solves it. Instead of: ```json { "internal": true,...