React - Uncaught ReferenceError: require is not defined
You need to use something like Rollup, Webpack, or Browserify. This statement import FormComponent from './FormComponent.js';
doesn't mean anything on the client. No browser natively supports it so you need something like the tools mentioned above to turn it into something the browser can actually use.
Without them you just have to load the files in your index.html.