Fast Refresh not working with automatic runtime and file extension without "x" #83
Closed
7 tasks done
Labels
enhancement
New feature or request
Describe the bug
Currently, fast refresh is working for a file only if either
React
in some wayNow when using a compile-to-JS language like ReScript with the new JSX runtime enabled, one can get
.js
or.mjs
files with imports from "react/jsx-runtime" or "react/jsx-dev-runtime", but noReact
import, and fast refresh will not work for these files.Reproduction
https://github.com/cknitt/vite-plugin-react-fast-refresh-issue
Steps to reproduce
TestComponent.bs.js
(alternatively change it in TestComponent.res and runnpm run res:build
to recompile). Observe that the counter value is reset to 0.Workaround
npx patch-package
to apply the patch frompatches/@vitejs+plugin-react+3.0.1.patch
.System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: