Export a component as an alias #1795
xypnox
started this conversation in
Ideas & RFCs
Replies: 1 comment
-
If we are exporting symbol defined in another module and want alias feature, we should do this this:
Because doing so without alias is currently is done like this:
So this is logical change. For symbols defined in current file, we can use an alias type:
This can be generic alias for anything, records, variables, components. Or we do:
This allows more than one aliases to be defined in one line (not sure I am fond of that, as that does not scale to many aliases, unless we allow:
Not sure I like it either. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Export a component declared inside a file or imported from some other dependency with a different alias.
Usecases
Re-expose larger components as defaults or rename a component to a smaller version when used externally.
Ex: There could be several hero components in a library, and
hero-image-right-cta
might be exported ashero
for ease of use as it would be the most used variant.Similarly,
secondary-button
could be exported asbutton
.Beta Was this translation helpful? Give feedback.
All reactions