Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Eslint doesnt see React components in use

I have been creating fresh react project. I cant run test component

import './App.css';
import {test} from './test';
import React, {Component} from 'react';
export default class App extends Component{
  render = () =>
    <div><test/></div>
  
}

Compiled with warnings.

src\App.js
Line 3:9: ‘test’ is defined but never used no-unused-vars

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

>Solution :

React components should be capitalized. Try

import { test as Test } from './test';
...
<div><Test/></div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading