-
-
Notifications
You must be signed in to change notification settings - Fork 212
Closed as duplicate of#402
Labels
Description
Describe the bug
When returning a plain string from a function component, the fast refresh is not added.
While I believe React does consider this as a valid component.
function Foo(props) {
return 'meh2';
}
let make = Foo;
export { make };Reproduction
https://stackblitz.com/edit/vitejs-vite-wzbtgaex?file=src%2FFoo.js
Steps to reproduce
- npm i
- npm run dev
- Edit Foo.js (page reload)
- Edit Bar.js (hmr reload)
System Info
System:
OS: macOS 15.3
CPU: (16) arm64 Apple M4 Max
Memory: 698.27 MB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.13.1 - ~/.nvm/versions/node/v22.13.1/bin/node
npm: 10.9.2 - ~/.nvm/versions/node/v22.13.1/bin/npm
pnpm: 9.15.5 - ~/.nvm/versions/node/v22.13.1/bin/pnpm
bun: 1.2.2 - ~/.bun/bin/bun
Browsers:
Brave Browser: 133.1.75.178
Chrome: 133.0.6943.99
Safari: 18.3
npmPackages:
@vitejs/plugin-react: ^4.3.4 => 4.3.4
vite: ^6.1.0 => 6.1.0Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- 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.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.