useEffect does not re-fire on hot reload with React 19
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Inizia con la riproduzione collegata e segui i passaggi elencati, in particolare alternando tra @vitejs/plugin-react-swc e @vitejs/plugin-react in vite.config.ts. Confronta il comportamento dell'hot reload con React 19; il lavoro è completato quando il salvataggio di un file fa sì che gli hook useEffect del componente interessato vengano eseguiti come nelle versioni precedenti di React.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Original issue filed here: https://github.com/vitejs/vite-plugin-react/issues/426, also applies to this plugin.
In prior versions of react, saving a file will trigger the components useEffect hooks to run. This does not work for react 19.
Reproduction
https://github.com/gkiely/swc-issue
Steps to reproduce
- In vite.config.ts, comment out @vitejs/plugin-react-swc and uncomment @vitejs/plugin-react
npm inpm run dev
Video example (using @vitejs/plugin-react-swc, but the same behavior is present for @vitejs/plugin-react)
https://www.loom.com/share/b493602e3f7244d2948c5bb871531881?sid=c9bdec15-5b87-4375-a659-6c63804cb032
System Info
System:
OS: macOS 12.7
CPU: (10) arm64 Apple M1 Pro
Memory: 316.34 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 20.2.0 - ~/.volta/tools/image/node/20.2.0/bin/node
Yarn: 1.22.18 - ~/.volta/tools/image/yarn/1.22.18/bin/yarn
npm: 10.8.0 - ~/.volta/tools/image/npm/10.8.0/bin/npm
bun: 1.1.13 - ~/.bun/bin/bun
Watchman: 2023.04.10.00 - /opt/homebrew/bin/watchman
Browsers:
Brave Browser: 114.1.52.129
Chrome: 125.0.6422.144
Edge: 125.0.2535.92
Safari: 17.5
npmPackages:
@vitejs/plugin-react: ^4.3.1 => 4.3.1
@vitejs/plugin-react-swc: ^3.5.0 => 3.7.0
vite: ^5.2.0 => 5.2.13
Used 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.
- Lingua principale
- TypeScript
- Stelle
- 1.2k
- Fork
- 287
- Merge medio
- 1g 17h
- PR unite (30g)
- 19
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vitejs/vite-plugin-react
-
plugin-rsc: a client reference's CSS is linked before the CSS of the chunks it imports (build)Forse già presa @wozhenbang2004 l’ha presa 7 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
vitejs/vite-plugin-react#1570 ·
I maintainer di solito rispondono entro 1 giorno
-
pending triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
vitejs/vite-plugin-react#1581 ·
I maintainer di solito rispondono entro 1 giorno
-
[plugin-rsc] Build exits 0, but the app fails at runtime: a server action imported only by browser code is missing from the RSC buildForse già presa @NeilPant l’ha presa 4 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
vitejs/vite-plugin-react#1578 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
vitejs/vite-plugin-react#1577 ·
I maintainer di solito rispondono entro 1 giorno
-
[plugin-rsc] inline "use server" function declarations lose hoisting and throw TDZ ReferenceErrorForse già presa @draarivpatel-ui l’ha presa 2 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
vitejs/vite-plugin-react#1566 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vitejs/vite-plugin-react
Issue simili
-
good first issue help wanted
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 86/100
Intelligenza-Umana/intelligenza-umana-web#16 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
open-webui/open-webui#35184 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
danielmiessler/LifeOS#3001 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno