It shows defined but never used for imported components; even though the very component is used. How do ignore this eslint warning?
Eg:
import { Provider } from 'react-redux';
....
and added inside render function
render(){
<Provider store={appStore}>
......
</Provider>
}
It show's Provider is defined but not used. Any help will be appreciated. Thanks,
I've finally fixed it here is the solution;
first, install the eslint-plugin-react
and make changes in your .eslintrc.json file.
{
...
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
...
}
Solution source: https://github.com/babel/babel-eslint/issues/6
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