Replies: 1 comment 1 reply
-
On further reflection I'd actually love just the last bit - runtime introspectable variant names. That way I could also remove the names from the rest of the props to avoid passing them down to React's primitives as unrecognized attributes. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I was hoping to create a simple HOC to quickly whip up components with applied VE classes, including automatically adding variant config to the props. Something like this:
The functionality and TypeScript typings seem to work well. However, if I just pass
props
to a recipe class generator, it will crash on unknown props, likechildren
:(from production source)
Could this function instead use
config.variantClassNames[variantName]?.[selection]
? I know the actual TypeScript typings of a recipe function would normally guarantee this as unnecessary, but it would be convenient for my purposes above.Alternatively, if VE could make the variant names easily runtime introspectable (e.g.
heading.variantNames
), I could filter the props by those keys before passing them in.Beta Was this translation helpful? Give feedback.
All reactions