We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fdaedc commit b85cd9eCopy full SHA for b85cd9e
docs/rules/no-unused-styles.md
@@ -95,6 +95,23 @@ const Hello = React.createClass({
95
}
96
});
97
```
98
+
99
+Dynamic styles are marked as used only if you use a local variable with the same name as the variable in the actual component .
100
101
+```js
102
+const getStyles = () => {
103
+ const styles = StyleSheet.create({
104
+ name: {}
105
+ })
106
+ return styles;
107
+}
108
+const Hello = React.createClass({
109
+ render: function() {
110
+ const styles = getStyles();
111
+ return <Text textStyle={styles.name}>Hello {this.props.name}</Text>;
112
+ }
113
+});
114
+```
115
Rules are also marked as used when they are used in tags that contain the word `style`.
116
117
```js
0 commit comments