Closed tribou closed 8 years ago
If you are using babel 6 and use the "require" syntax instead of "import" you must reference a default export as a property. For the Layout component it would look like:
const Layout = require('./layout.jsx').default;
Using the es6 modules syntax would work also.
import Layout from './layout.jsx';
You can see more information in this StackOverflow answer.
That worked. Thanks, @tkh44!
If I try to convert your
layout
example to use ES6 classes, I'm getting an error. However, I am able to convert the home.jsx.For example, changing only the
home.jsx
works with:However, when I convert the
layout.jsx
file as well like this:I get this error:
Am I implementing this correctly?