4 ms·
Sometimes you don't care what the importing module names your thing, and it's the only thing your module does. Think of a super simple React component... I'm `e
by hashkb 9y ago
Sometimes you don't care what the importing module names your thing, and it's the only thing your module does. Think of a super simple React component... I'm `export default function(props) { ... }`ing that every time. Is that bad?
- wmonk 9y agoAFAIK it's bad practise to export components like that, as they won't have a displayable name in devtools etc.
- dmitriid 9y agoPure/function-only components will not have a name anyway
- wmonk 9y agoI think they get their display name from the variable name
- zenojevski 9y agoexport default function MyComponent(props) { };
- connorelsea 9y agoThis is not a bad practice export default class C extends React.Component { ... }