Solution : ReactJs Error 'Component' is not defined no-undef.



Solution : ReactJs Error 'Component' is not defined no-undef.  Search for the keywords to learn more about each error. This error occurred during the build time and cannot be dismissed.


When creating a react application the following error comes  "'Component' is not defined no-undef."



Here is my code from ReactJs   src/App.js


import React from 'react';
import logo from './logo.svg';
import './App.css';

class App extends Component {

 render () {
    return (
      <div className="App">
            My First App
      </div>
    )
  }

}

when i try to execute the above program of ReactJs  there is a error "'Component' is not defined no-undef."




The solutions is as below

import React, {Component} from 'react';
import logo from './logo.svg';
import './App.css';

class App extends Component {
 render () {
    return (
      <div className="App">
            My First App
      </div>
    )
  }

}


This above piece of code fixed the error and page started to render on the browser

Comments

  1. thanks alot, keep on posting for help :)

    ReplyDelete
  2. It helped me a lot. Thank you very much

    ReplyDelete
  3. Thanks a ton!!
    Saved me a lot of trouble!

    ReplyDelete
  4. Thanks a lot really fixed my bug

    ReplyDelete
  5. it still showing that error

    ReplyDelete
    Replies
    1. due to case sensitive it pop out that error

      Delete
  6. hello i do that but give me the same error but i create new file called Navbar in folder called Component

    ReplyDelete
  7. I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.best render farm

    ReplyDelete
  8. Great job for publishing such a nice article. Your article isn’t only useful but it is additionally really informative. Thank you because you have been willing to share information with us.render Farm

    ReplyDelete
  9. You have shared a nice article here about the Nike Air Jordan Blue . Your article is very informative and nicely describes the causes and natural remedies of Snoring. I am thankful to you for sharing this article here.Nike Air Jordan Blue online in India

    ReplyDelete
  10. Great job for publishing such a nice article. Your article isn’t only useful but it is additionally really informative. Thank you because you have been willing to share information with us.render Farm

    ReplyDelete

Post a comment