I have a problem on compiling a react app. The module was not found and the error was.
Module not found: Can't resolve './components/MyInfo' in 'c:\xampp\htdocs\reactjs\src'
Here is the file structure of the project.
reactjs
|- git
| L ...
|- components
| L MyInfo.js
|- node_modules
|- public
| L index.html ...
|- src
| L index.js
Here is my file that contains JSX, filename: index.js
import React from 'react'
import ReactDOM from 'react-dom'
import MyInfo from './components/MyInfo'
ReactDOM.render(
<MyInfo />,
document.getElementById('root')
);
Here is my file that contains the function.
path and filename: reactjs/components/MyInfo.js
import React from 'react'
function MyInfo() {
return (
<div>
<h1>J2</h1>
<p>I am a gamer</p>
<ul>
<li>Tokyo Japan</li>
<li>Ontario Canada</li>
<li>Beijing China</li>
</ul>
</div>
)
}
export default MyInfo
How can I locate component/MyInfo.js
?
Thanks