-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hot reload is complaining about named functions in nextjs #117
Comments
same answer as in #114: that's an issue with next.js not with d3-format |
Hi @Fil , thanks for the quick feedback on this. Just to clarify that this issue is related to anonymous function declarations rather than any module discussion I am willing to open a PR that will change the default anonymous functions to named functions. The functionality will be exactly the same, but will help other frameworks that rely on fast refresh, will help debugging and so on. |
@Fil don't you think @cipriancaba suggestion would help make d3 works properly for more users out there ? |
./node_modules/d3-format/src/index.js
Anonymous function declarations cause Fast Refresh to not preserve local component state.
Please add a name to your function, for example:
Before
export default function () { /* ... */ }
After
export default function Named() { /* ... */ }
A codemod is available to fix the most common cases: https://nextjs.link/codemod-ndc
This was referenced in #114 as well
The text was updated successfully, but these errors were encountered: