Rewrite the title to: Translate "SyntaxError: Cannot use import statement outside a module" into Chinese as "SyntaxError: Cannot use import statement outside a module" when running on the live server
<p>//This is the greet.js file</p>
<pre class="brush:php;toolbar:false;">import React from "react";
functionGreet()
{
return (
<div><h1>Welcome</h1></div>
)
}
export default Greet</pre>
<p>//This is the indx.js file</p>
<pre class="brush:php;toolbar:false;">import React,{Component} from 'react'
import Greet from './Greet'
class App extends Component
{
render()
{
<div className='App'>
<Greet/>
</div>
}
}</pre>
<p>//This is an html file</p>
<pre class="brush:php;toolbar:false;"><!DOCTYPE html>
<html>
<head>
<title>
Here We Go
</title>
</head>
<body>
<script src="indx.js"> </script>
</body>
</html></pre>
<p>I'm trying to get data from greet.js and render it in indx.js, but I get the <strong>Cannot use import statement outside module error</strong></p>