...
inference for components.
#1968
Closed
siddhantk232
started this conversation in
Ideas & RFCs
Replies: 2 comments 6 replies
-
I wonder where else can we use |
Beta Was this translation helpful? Give feedback.
6 replies
-
Closing this in favor of https://github.com/orgs/fastn-stack/discussions/463 |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say I want to create a wrapper component around the design system's
heading-large
component such that I get a button to copy the link to that section.This is cumbersome. We should support this usecase as it's pretty common to compose components on top of existing components in the frontend world (there are so many articles on higher order components).
Here's the syntax I suggest:
The compiler will figure out the header that
ds.heading-large
has declared and will add them to theheading-large-id
component. If multiple components exist thenheading-large-id
will have the union of those headers. Here's an example:The above is a syntax sugar that will be processed by the compiler to:
design system has a lot of components that accept so many headers and this feature can be a god send for someone who wants to create wrapper components.
Beta Was this translation helpful? Give feedback.
All reactions