You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i18n in my react project is implmented by wrap jsxDEV which is export from react/jsx-dev-runtime, just like interceptor before render.
What happened?
The translate behavior is not expected in serve mode and unexpected result after vite build.
After checking, the more specified detail is there would be two copies of react/jsx-dev-runtime:
@vitejs/plugin-react use one;
other one imported by myself;
What the unexpected behavior is the 1st one would compile after vite serve, and the 2nd would excute if I trigger hot update behavior, for example, save file.
The expected behavior
The @vitejs/plugin-react is powerful, but what should I do to adapt in my case.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
Just in above case someone else wanted to get some advice.
Since I don't get any response or comments, as compromise, I adjusted the implementation... give up modify react's "render" methods except for React.createElement.
Describe the bug
Background
i18n in my react project is implmented by wrap
jsxDEV
which is export fromreact/jsx-dev-runtime
, just like interceptor before render.What happened?
The translate behavior is not expected in serve mode and unexpected result after
vite build
.After checking, the more specified detail is there would be two copies of
react/jsx-dev-runtime
:@vitejs/plugin-react
use one;What the unexpected behavior is the 1st one would compile after
vite serve
, and the 2nd would excute if I triggerhot update
behavior, for example, save file.The expected behavior
The
@vitejs/plugin-react
is powerful, but what should I do to adapt in my case.Reproduction
https://github.com/wqcstrong/vite-issues
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: