What are the best practices for "integrating" a React app into an existing HTML landing page?
For example, I have a marketing page on mypage.com/ and would like to use the react app on mypage.com/app only.
What I tried is to use react router and use the dangerouslySetInnerHTML function to include the HTML page but for this case I need to use a html-loader and I use react-scripts instead of the webpack.config so I think it is not possible to add the loader. Isn't it?
<Router>
<Route path="/" exact component={Landingpage} />
<Route path="/app" exact component={App} />
</Router>
/* Landingpage */
return () {
<div ... dangerouslySetInnerHTML={{ __html: html }} />
}
I tried the following but I don't have the webpack.config because I use react-scripts. React: how to load and render external html file?
What I want is to call yarn build and receive the finished application. Do you have any suggestions how I can reach that?
Thanks so much in advance!