Error: 'App' is not defined react/jsx-no-undef in React
Dung Do Tien Jan 23 2021 246
I create a simple component form with Reactjs but I got error: 'App' is not defined react/jsx-no-undef
Below is my
App.js file:
import React, { Component } from 'react' class App extends Component { render() { return ( <div>Demo component</div> ) } } export default App
Thank you many for any solution.
Have 1 answer(s) found.
- T0
Tu Hoang Jan 23 2021
Hi, this error raise when you use an object but not declare it.
You only need to import + object component into
index.jsfile as below:
import App from "./App";
I hope it's helpful for you.
If this answer is useful for you, please BY ME A COFFEE!!! I need your help to maintain blog.
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.