Open naveen2103 opened 3 years ago
can any one help me to solve this problem and say why it occurs because i beginner to this reactjs
You just have have to correct "import ReacrDOM from ...." into "import ReactDOM from react-dom" The letter 'r' has to be replaced by 't' and give you and also, my advise will be to always put "import React from ...." on top
import ReactDOM from 'react-dom';
import React from 'react';
Make sure to close the issue and it would be great to leave me a star on my profile. You can also fork this Todo-list and get a full ReactJS template project. I am a ReactJS developer and will gladly help you if you have further questions or require an advice on this topic. 👍🏾 Eskabore
import React from "react"; import ReactDOM from "react-dom"; import Heading from "./Heading"; import Para from "./Para"; import List from "./List" function App(){ return ( <>
</> ); }
export default App;
src\index.js Line 4:1: 'ReactDom' is not defined no-undef Line 6:2: 'App' is not defined react/jsx-no-undef
Search for the keywords to learn more about each error.
ReactDOM and ReactDom are different words, check your spelling ,it should be ReactDOM. React is case sensitive
Thank you for the response, I experienced the same problem then capitalized DOM then everything worked.
This is my code: import ReactDOM from 'react-dom'; import React from 'react'; import './index.css'; import App from './App';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render( <>
</> )
and this is the error I'm getting:
[eslint] src\root.js Line 1:21: 'ReactDOM' is not defined no-undef Search for the keywords to learn more about each error. ERROR in [eslint]
I need Help Please!
code i used :
import ReactDOM from 'react-dom'; import React from 'react';
const App= () =>(
Hello first React project
ReactDOM.render( ,document.getElementById('root'))
error i got : Failed to compile.
src/index.js Line 14:1: 'ReactDOM' is not defined no-undef
Search for the keywords to learn more about each error.