'Text' is defined but never used no-unused-vars
Here is the code section gets error
import {
Text,
StyleSheet,
} from 'react-native';
import color from './color';
export const Sub = styled.Text`
color: ${color.secondary};
font-size: 16;
text-align: center;
margin: 8px;
as we can see the Text
has been consumed by Sub
, since we don't want remove the no-unused-vars
rule, we may need a plugin or setting to walk-around this
Thanks @Dan, you saved me from my tunnel vision
Assuming that Text
is a component, the documentation says that the correct way to declare it is:
export const Sub = styled(Text)`
color: ${color.secondary};
font-size: 16;
text-align: center;
margin: 8px;
`
It would also solve the eslint issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With