-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hi,
I am loving the detail in the readme. Please could you share your opinion on the export default vs export { named } debate.
When exporting with default, e.g. a react component.
./components/MyButton.tsx
const MyButton = () => (<div><div/>);
export default MyButton;I am free to import this with any name that I please;
App.tsx
import SomeButton from "./components/MyButton";
...This is not ideal for refactoring and avoiding typos in the names. If we also switch too exporting multiple modules from the same file we then have to refactor the exporting approach and all the references to it.
Thank you for taking the time to read this, I would love to hear your opinion on the above. Thanks again for what you have share :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels