You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
StyledProps currently does a look up on React Native style types and csstype, to pull in types from the project's used versions of those dependencies. This seems to work well for most style props.
However, there are some, like alignItems, alignSelf, display etc that exist on both React Native style types and CSSTypes, and which have very permissive types like string on csstype which allows invalid values. There's an issue on their repo for that frenic/csstype#8 - to summarise: it's to allow space-separated multi value strings, which are seldom used, but are technically valid in CSS.
The net result is, some style props like alignItems end up accepting any string:
...but the actual app will crash on Android if the value is not one of the known allowed values listed in the React Native style type:
Problem Statement
If a prop will cause a hard crash in Android, NativeBase's types should flag it as invalid.
Proposed Solution or API
I think this could be solved by switching the order on the type selector to choose React Native first then CSSTypes if both have the given key? Currently, if a key exists in both, the csstype type is used and the RN type is ignored.
Alternatives
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
We just faced this very situation this week: our app started crashing on android (production build). We spent a few days to understand what was the problem. Turned out , it was a misspelled string property value. This is probably a bug because I've got a previous project (on bitbucket, not on github but I can share the link if necessary) where the types are correct and intellisense is working as expected.
Description
StyledProps
currently does a look up on React Native style types and csstype, to pull in types from the project's used versions of those dependencies. This seems to work well for most style props.However, there are some, like
alignItems
,alignSelf
,display
etc that exist on both React Native style types and CSSTypes, and which have very permissive types likestring
on csstype which allows invalid values. There's an issue on their repo for that frenic/csstype#8 - to summarise: it's to allow space-separated multi value strings, which are seldom used, but are technically valid in CSS.The net result is, some style props like
alignItems
end up accepting any string:...but the actual app will crash on Android if the value is not one of the known allowed values listed in the React Native style type:
Problem Statement
If a prop will cause a hard crash in Android, NativeBase's types should flag it as invalid.
Proposed Solution or API
I think this could be solved by switching the order on the type selector to choose React Native first then CSSTypes if both have the given key? Currently, if a key exists in both, the csstype type is used and the RN type is ignored.
Alternatives
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: