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
The rule no-unused-styles is unable to discriminate between actually unused styles, and an entire StyleSheet object being passed through to a component.
In particular, I am using react-native-htmlview, which accepts a stylesheet prop containing an object created through StyleSheet.create( ... ). When I pass the entire stylesheet to this prop, the no-unused-styles fails. See the example below:
The rule
no-unused-styles
is unable to discriminate between actually unused styles, and an entire StyleSheet object being passed through to a component.In particular, I am using
react-native-htmlview
, which accepts astylesheet
prop containing an object created throughStyleSheet.create( ... )
. When I pass the entire stylesheet to this prop, theno-unused-styles
fails. See the example below:The only solution is to wrap the
StyleSheet.create( ... )
portion withineslint-disable
andeslint-enable
rules:It is not a major issue, as you can see it can easily be worked around.
However it's still annoying, and I'd like not to have to care about this.
The text was updated successfully, but these errors were encountered: