So I decided to learn React and on the very first project I got an error message.
Failed to compile
./src/index.js
Attempted import error: './App' does not contain a default export (imported as 'App').
It's simple "Hello World" code. I have 2 files for that.
App.js
import React from 'react';
import ReactDOM from 'react-dom';
import HelloWorld from './HelloWorld';
ReactDOM.render(
<HelloWorld />,
document.getElementById('root')
);
HelloWorld.js
import React, { Component } from 'react';
class HelloWorld extends Component {
render() {
return (
<div className="helloContainer">
<h1>Hello, world!</h1>
</div>
);
}
}
export default HelloWorld;
I read every post about this problem, none of them works. I also read that it's usually problem with reactstrap, but I don't have it installed.
Any help would be appreciated.
./src/index.jsfile code since that is where the error is saying the problem is.