useflyyer / next-rosetta

Next.js + Rosetta + TypeScript with native i18n support | Lightweight, simple, easy to integrate, no custom server required and efficient because will only download the locale you need.
https://next-rosetta.vercel.app
MIT License
64 stars 4 forks source link

remove state from I18nProvider #25

Closed Drapegnik closed 2 years ago

Drapegnik commented 3 years ago

fix #24

  1. why you create new rosetta instance on every update? - just set works fine
  2. when you set instance state - it leads to 1 extra render - I use ref instead
vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/flyyer/next-rosetta/77dEHusnJtLiU7ACCPxu4TQVq6XJ
✅ Preview: https://next-rosetta-git-fork-drapegnik-main-flyyer.vercel.app

lopezjurip commented 3 years ago

Thanks for the contribution @Drapegnik, I'm going to test it during this week. In the meantime I released your PR with tag useref on npm:

npm install --save next-rosetta@useref
yarn add next-rosetta@useref
Drapegnik commented 3 years ago

@lopezjurip, hi! any updates?