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
React schematics exports both "named" and "default" for components? #3021
Comments
We export both so that consumers can pick what suits them best. However, it is true that the default export can't be used when importing it from another library. @jaysoo We discussed this a while ago and thought that React developers would be more comfortable using the default export. However, the default export not being able to be used when importing it from a library is a little confusing. Any thoughts? |
|
Does nx support importing from nested folders? const LazyLoadedComponent = import("@package-b/core/component") You have to do: const LazyLoadedComponent = import("@package-b/dist/core/component") Which is no that clean and common as when using npm registry packages. |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
any thoughts on my proposal ? @jaysoo @FrozenPandaz |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
I want to be able to configure my project to generate named exports only. Where did the team get to on this? |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Hi,
Just started working with the react schematics and I notice that when you create a new UI component it exports both a named export and a default export.
Is there any reason for this?
I was looking at a tutorial by NX but it was never touched upon but I do notice that when consuming the UI components we import them using the "named" export.
I was wondering why?
I much prefer named exports so I was wondering why we are exporting default?
I seemed to remember a while ago I remember reading about an edge case where a named import had a problem with being consumed somewhere in react - but I just can't find it.
Its worth noting that even though the default export is there, it cannot be consumed from app.tsx for example
Would love to hear some feedback why, I mean, its there - so it must be there for a reason :-)
The text was updated successfully, but these errors were encountered: