I should be able to export my App component file and import it into my index.js.
I get the following error
React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object
My index.js
const React = require('react');
const ReactDOM = require('react-dom');
const App = require('./components/App');
require('./index.css');
ReactDOM.render(
<App />,
document.getElementById('app')
);
Then in my components/App.js
const React = require('react');
export default class App extends React.Component {
render() {
return (
<div>
Hell World! Wasabi Sauce!
</div>
);
}
}
// module.exports = App;
If I uncomment module.exports = App; it will work, but I'm trying to use the export syntax. In another project I am doing the exact same thing here and it's working fine