Feedback wanted: New Hot Reloading
I’m working on hot reloading again. Got a very raw alpha version working. It preserves state but only for function components. Works with Hooks. You can try the alpha version (**not production ready, super experimental**): ### Trying in a New Project (NOT FOR PRODUCTION) ``` npx create-react-app demo --scripts-version wonky-scripts ``` ### Trying in an Existing Project (NOT FOR PRODUCTION) 1. Replace `react-scripts` dependency with `wonky-scripts@0.0.5` 2. Keep `scripts` the same 3. Delete `node_modules/.cache` 4. Run Yarn/npm 5. Start the project and try editing your React components ### What It Looks Like It’s expected that it will work something like on this gif: https://twitter.com/dan_abramov/status/1139876172903395329 ### Constraints (Library Authors, Read This!) If your Hook or Component doesn't work with hot reload, keep in mind that: * `useMemo` and `useCallback` caches are dropped on every edit (otherwise there wouldn't be a way to edit them 😅). If this breaks your code, consider `useRef` which gives you a semantics guarantee about not getting re-created. Like [here](https://github.com/alexreardon/use-memo-one). Usually there's a way to restructure the code to be more resilient. * Same goes for `useEffect`. During hot reload, dependency array will be ignored, and even effects with `[]` dependencies will re-run. If this breaks your component or Hook, there's likely a way to restructure it to fix this. As a bonus, this will make it easier for you to later
Posted by gaearon on Jun 15, 2019, 1:07 PM
Tags
Related issues
- 2026 - Microsoft Office 365
- [Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
- Gamut mapping
- [Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
- [Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
- [BUG]: infinite loading of videos
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
github (SaaS)
2026 - Microsoft Office 365
[Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
Gamut mapping
[Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
[Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
[BUG]: infinite loading of videos
Restore GPT-5.6 Sol’s 372k Codex context window, or provide an opt-in setting
Codex Desktop for macOS repeatedly triggers `syspolicyd` / `trustd` CPU and memory runaway
Feedback wanted: New Hot Reloading
I’m working on hot reloading again. Got a very raw alpha version working. It preserves state but only for function components. Works with Hooks. You can try the alpha version (**not production ready, super experimental**): ### Trying in a New Project (NOT FOR PRODUCTION) ``` npx create-react-app demo --scripts-version wonky-scripts ``` ### Trying in an Existing Project (NOT FOR PRODUCTION) 1. Replace `react-scripts` dependency with `wonky-scripts@0.0.5` 2. Keep `scripts` the same 3. Delete `node_modules/.cache` 4. Run Yarn/npm 5. Start the project and try editing your React components ### What It Looks Like It’s expected that it will work something like on this gif: https://twitter.com/dan_abramov/status/1139876172903395329 ### Constraints (Library Authors, Read This!) If your Hook or Component doesn't work with hot reload, keep in mind that: * `useMemo` and `useCallback` caches are dropped on every edit (otherwise there wouldn't be a way to edit them 😅). If this breaks your code, consider `useRef` which gives you a semantics guarantee about not getting re-created. Like [here](https://github.com/alexreardon/use-memo-one). Usually there's a way to restructure the code to be more resilient. * Same goes for `useEffect`. During hot reload, dependency array will be ignored, and even effects with `[]` dependencies will re-run. If this breaks your component or Hook, there's likely a way to restructure it to fix this. As a bonus, this will make it easier for you to later
Comments (0)
No comments yet. Start the discussion.