eslint-plugin-react-native
eslint-plugin-react-native copied to clipboard
no-unused-styles does not support destructuring assignment
The styles are are marked as errors when the styles are destructed. Destructuring Assignment
class App extends Component {
render() {
const { container, welcome, instructions } = styles;
return (
<View style={container}>
<Text style={welcome}>
Welcome to React Native!
</Text>
<Text style={instructions}>
To get started, edit index.ios.js
</Text>
<Text style={instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
Thanks for the issue, that should definitely be supported.
+1
+1
+1
+1
Hello, unfortunately the problem still persists
Any solution / workaround / alternative to this ?
#300
Added the support
Approve if you want to use it
+1