-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
[Feature](Docs) Give names to anonymous arrow functions in docs examples #17200
Comments
Feel free to send a PR. |
Hey, if this issue is not assigned to anyone, can I take this up? |
For sure @Jashnm, regular functions is fine! |
Obviously the PR is going to be reviewed by one of the Next.js maintainers but I wanted to say that it looks good to me. Nice contribution @Jashnm ! |
Why is exporting anonymous functions a bad practice? @awareness481 |
import something from 'somewhere' // Something is internally called foo though
import { foo as something } from 'somewhere' // can find-replace foo easily here this goes hand in hand with better refactoring support in editors
Personally, I consider default exports to be bad practice because of mentioned reasons and actively lint against them. In places where I have to use default exports, e.g. nextjs pages, I |
Thank you for your answer @ljosberinn ! |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
For example, in api-routes
we have this example
Exporting anonymous functions is arguably bad practice. If this agreed upon, I think any examples containing anonymous exports should be changed to use named functions
The text was updated successfully, but these errors were encountered: