facebook / react

The library for web and native user interfaces.
https://react.dev
MIT License
224.77k stars 45.84k forks source link

[Compiler Bug]: A bug with i18n translation after react compiler #29195

Open YYGod0120 opened 1 month ago

YYGod0120 commented 1 month ago

What kind of issue is this?

Link to repro

https://github.com/YYGod0120/yyblog

Repro steps

  1. Change the var in app/[language]/components/Typewrite.tsx to const (use var to skip the compiler and fix the bug)
  2. use pnpm dev to start project
  3. Click twice on the lanswitcher and find that the Banner is not translated after the second click.

How often does this bug happen?

Every time

What version of React are you using?

v19.0.0-rc-3f1436cca1-20240516

testhowtest commented 1 month ago

15038 involves i18n and deals with errors caused by instantiating i18next when dynamically combining multiple applications. Though the descriptions vary slightly, both issues revolve around i18n and potential related problems. There might be some common patterns or issues among them.

YYGod0120 commented 1 month ago

15038 involves i18n and deals with errors caused by instantiating i18next when dynamically combining multiple applications. Though the descriptions vary slightly, both issues revolve around i18n and potential related problems. There might be some common patterns or issues among them.

Thank you for your advise. I don't know if it's a problem with i18n or react-compiler. After I skipped compile, the display was normal and I didn't see any errors. So I prefer it to be a compiler problem.

YYGod0120 commented 1 month ago

By the way, I moved the problem to the branch of compilerBug. I bypassed this problem on the main branch and updated it.