I am working on a website and tried to include a ReactJS component and I'm doing it like so:
import React from "react";
import ReactDOM from "react-dom";
import Layout from "Layout.jsx";
const app = angular.module('myApp');
const reactDirective = app.directive('reactDirective', function() {
return {
template: '<div id="reactapp"></div>',
link: function(scope, el, attrs){
ReactDOM.render(<Layout/>, document.getElementById('reactapp'));
}
}
});
and the Layout.jsx
import React from 'react';
export default class Layout extends React.Component {
constructor(props){
super(props);
}
render() {
return (
<div>
This is ReactJS
</div>
);
}
}
However whenever it compiles, it gives me
ERROR in ./react-app.js
Module not found: Error: Cannot resolve module 'layout.jsx'
Can anyone tell me what's wrong with my code?