score:26
Accepted answer
name this "component" only if you need call them in some part of the code.
e.g. using css-modules. this is only a regular css so load in this manner :
import '../styles/base.css'
but if you still want to keep this unused var you can edit your es-lint, and delete this rule. (not recommended)
score:1
you do not need "css from" since the css file is already connected to the jsx file. you only do that when using other jsx components, for example:
import somecomponent from '../somecomponent.jsx'
Source: stackoverflow.com
Related Query
- 'Fragment' is defined but never used no-unused-vars warning with React app using ESLint
- React, warning 'css' is defined but never used no-unused-vars
- emotion-js on Create React App - 'jsx' is defined but never used
- warning 'ScrollingHorizontally' is defined but never used no-unused-vars
- How to solve this Reactjs Eslint warning about 'index' is defined but never used
- warning : is defined but never used
- 'React' is defined but never used
- Stateless component in React and "Props is defined but never used" ESLint error
- src\App.js 'nav' is defined but never used no-unused-vars
- React input, I defined the state into initial state but still get warning changing uncontrolled to controlled input
- PropType is defined but prop is never used for arrow function with single argument
- React app reports unused image, but it actually was used
- Compilation Error: is defined but never used no-unused-vars
- warning: it is defined but never used
- React - 'state' is assigned a value but never used no-unused-vars
- 'Product' s defined but never used in react?
- 'API_KEY' is defined but never used 'CONTEXT_KEY' is assigned a value but never used
- Why is my header component defined but never used in my test?
- React - class declared but never used, but it is used
- 'ImgOverlay' is defined but never used "React-Bootstrap"
- Setting a state in react but keep getting an error 'state' is assigned a value but never used no-unused-vars
- Assigned values but never used on React form
- React cannot display json - data is assigned a value but never used
- 'Header' is defined but never used no-unused-vars
- 'useState' is defined but never used EVENTHOUGH I have used useState hook
- 'UserInput' is defined but never used no-unused-vars 'UserOutput' is defined but never used no-unused-vars
- Why do I have to .bind(this) for methods defined in React component class, but not in regular ES6 class
- Remove unused css with React and Webpack
- How to fix the console warning "The resource ... was preloaded using link preload but not used within a few seconds from the window's load event"?
- PropTypes defined, but never used (ESLint, babel 6)
More Query from same tag
- ReactJS: how to access prop from child component
- How to react function component in like a toggle button
- React link (using react router) in sidebar when clicked multiple times causes url param to repeat
- why it is showing error "Cannot read property 'have' of undefined"?
- I want to log an action everytime a user clicks (highlights) an input field to enter a value into it. What can I do to achieve such functionality?
- parse mixed jsx and html in react
- Why isn't a DOM node rendered by React considered a node by React.PropTypes.node validation?
- react create app, typescript unit test with mocha and chai what is the correct setup to support es6 modules?
- ReactJS apply multiple inline styles
- How to add defaultprops or value in react
- How to save old state values react
- MUI datagrid specific rows with bold text
- this.state value not updating from console
- Correct way to update react component from secondary source
- React.js synchronity problem with hooks. Connect Four game move
- Name output by button
- React Router and History
- '_isMockFunction' of undefined
- Avoiding event chains with asynchronous data dependencies
- useEffect validation in Reactjs
- Using mixins in material-ui to customize components in React
- Webpack 4 as JSX files
- TypeError: Cannot read property 'map' of undefined in react-redux
- Meteor & React | Login Logout navigation
- Disable specific days in material ui calendar in React
- Can I bundle react.js apps into multiple modules?
- React + Typescript: Properly Typing General Component with Props that have Functions with Optional Generic Types
- React Number Easing
- How to use themify configs with ::-webkit-scrollbar-thumb
- rendering data from an array of objects using an onclick