eslint-plugin-react-native
eslint-plugin-react-native copied to clipboard
accessing styles using bracket notation counts as a failure
I would expect the following to pass, but it does not.
const styles = StyleSheet.create({
foo: { /* styles */ }
})
() => {
const bar = 'foo'
return <View style={styles[bar]} />
}
hi @beeglebug, in this case it might be possible to inline the key, but for more complex cases where bar
is dynamic it will be hard to infer which styles are referenced. In these cases you might want to disable the rule for that specific line