MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/reactjs/comments/jgp4wi/create_react_app_40_is_published/g9ue5wc/?context=3
r/reactjs • u/darekkay • Oct 23 '20
62 comments sorted by
View all comments
1
What’s this import/no-anonymous-default-export crap? Who comes up with this stuff?
import/no-anonymous-default-export
3 u/soulsizzle Oct 24 '20 https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-anonymous-default-export.md 2 u/acemarke Oct 24 '20 Dan Abramov explains why this is important here:https://twitter.com/dan_abramov/status/1255229440860262400If you write "export default () => { ... }" to declare components, they:will show up as Anonymous in stack traceswill show up as Unknown in DevToolswon't be checked by React-specific lint ruleswon't work with some features like Fast RefreshGive components names! 1 u/BransonLite Oct 24 '20 Naming components is fine but the rule isn’t component specific unless a misread. 2 u/Tomus Oct 24 '20 This issues with default anonymous exports don't just apply to components, they apply to all functions.
3
https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-anonymous-default-export.md
2
Dan Abramov explains why this is important here:
https://twitter.com/dan_abramov/status/1255229440860262400
If you write "export default () => { ... }" to declare components, they:will show up as Anonymous in stack traceswill show up as Unknown in DevToolswon't be checked by React-specific lint ruleswon't work with some features like Fast RefreshGive components names!
If you write "export default () => { ... }" to declare components, they:
will show up as Anonymous in stack traces
will show up as Unknown in DevTools
won't be checked by React-specific lint rules
won't work with some features like Fast Refresh
Give components names!
1 u/BransonLite Oct 24 '20 Naming components is fine but the rule isn’t component specific unless a misread. 2 u/Tomus Oct 24 '20 This issues with default anonymous exports don't just apply to components, they apply to all functions.
Naming components is fine but the rule isn’t component specific unless a misread.
2 u/Tomus Oct 24 '20 This issues with default anonymous exports don't just apply to components, they apply to all functions.
This issues with default anonymous exports don't just apply to components, they apply to all functions.
1
u/BransonLite Oct 24 '20 edited Oct 24 '20
What’s this
import/no-anonymous-default-exportcrap? Who comes up with this stuff?