Gracefully ignore invalid props in calls to sprinklesFn #790
Unanswered
liam-jones-lucout
asked this question in
Q&A
Replies: 0 comments
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.
-
Currently, if making a
<Box>
style component and allowing sprinkles props to be passed in as component props, passing in a prop not found within the Sprinkle properties causes a crash.I think that there's an argument to be made for it to gracefully ignore missing properties. That would allow users to change the definition of an atomically styled Box from this:
to this:
I think currently the only way to implement what I'm asking is to wrap the SprinklesFN in my own function that calls properties.has on each property, which would add an additional loop over the properties that the library is doing anyway. If there is another solution, please let me know.
Beta Was this translation helpful? Give feedback.
All reactions