I am new to react js, i am trying to create react js based simple page using export and import functionality. Below is the description
App.jsx
import React from '../build/react' export default class App extends React.Component { render() { return ( <div> Hello World!!! </div> ); } }main.jsx
import {ReactDOM} from '../build/react-dom' import {App} from 'App' ReactDOM.render(<App />, document.getElementById('app'));test.html
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="build/browser.min.js"></script> <script src="custom/main.jsx"></script> </head> </html>
I have deployed it on tomcat, when i am trying to access "test.html" from browser it is giving me
Uncaught SyntaxError: Unexpected token import at main.jsx : 1
Please help me, whether i have missed anything in this.
importandexportwill not work natively in the browser. - Davin Tryon