BUGFIX cssInterop only triggering when a param is passed#768
BUGFIX cssInterop only triggering when a param is passed#768kimchouard wants to merge 3 commits intonativewind:mainfrom
Conversation
|
@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 thecolumnWrapperStyleparam when itsnumColumnsparam 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 nocolumnWrapperStylewas set.👉 With this proposed fix, the props are only remapped if a value is passed to the original component.
E.g.:
<FlatList />with nocolumnWrapperStyleand nonumColumns(default=1) param won't trigger errors anymore.columnWrapperStyleorcolumnWrapperClassNamewere 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 🤓