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
BUGFIX cssInterop only triggering when a param is passed #768
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@kimchouard I think adding a description with the details of your issue would be helpful :) |
Indeed, thanks for raising it 😅 I've created this PR using I've updated the description, hopefully it's more clear now! ;) |
@marklawlor FYI I've integrated your latest changes from master to make this PR ready to be merged 🤓 |
Does this only affect web or should there be a native equivalent to this as well? I should appreciate a unit test to demonstrate the fix. You can find some in |
It's only affecting Web. I'll work on a unit test this week, sorry first contribution to this repo 🙏 |
Fixing issue #767: edge cases on prop remapping, to ensure that props are only (re)mapped if a value is passed.
E.g.:
<FlatList />
only accept thecolumnWrapperStyle
param when itsnumColumns
param is> 1
. With the current implementation ofcssInterop
, an empty array was passed to all remapped parameters, introducing an unexpected breaking error (Uncaught Invariant Violation: columnWrapperStyle not supported for single column lists
), even though nocolumnWrapperStyle
was set.👉 With this proposed fix, the props are only remapped if a value is passed to the original component.
E.g.:
<FlatList />
with nocolumnWrapperStyle
and nonumColumns
(default=1) param won't trigger errors anymore.columnWrapperStyle
orcolumnWrapperClassName
were to be added, it would be then be remappedBUT the end user would have also set
numColumns > 1
(otherwise there is no point in callingcolumnWrapperStyle
:).It's my first PR on this repo, so lmk if I missed a step 🤓