Unverified Commit 23111ca0 authored by GH Lee's avatar GH Lee Committed by GitHub

Update fast-refresh.md (#18047)

ref. https://github.com/vercel/next.js/pull/14519, https://github.com/vercel/next.js/pull/15062
Add limitation for Anonymous arrow functions.
parent feb10f45
...@@ -77,6 +77,7 @@ local state being reset on every edit to a file: ...@@ -77,6 +77,7 @@ local state being reset on every edit to a file:
- Sometimes, a file would export the result of calling higher-order component - Sometimes, a file would export the result of calling higher-order component
like `HOC(WrappedComponent)`. If the returned component is a like `HOC(WrappedComponent)`. If the returned component is a
class, state will be reset. class, state will be reset.
- Anonymous arrow functions like `export default () => <div />;` cause Fast Refresh to not preserve local component state. For large codebases you can use our [`name-default-component` codemod](/docs/advanced-features/codemods.md#name-default-component).
As more of your codebase moves to function components and Hooks, you can expect As more of your codebase moves to function components and Hooks, you can expect
state to be preserved in more cases. state to be preserved in more cases.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment