For a page that has mostly static HTML and a few dynamically rendered elements, is it best practice to render all HTML through React, or to leave the static HTML in an HTML file and only render targeted elements as needed with React?
Here’s what I’m considering for the why, feedback welcome:
- All HTML in React: because this ensures all HTML is coming from one centralized location and is easier to understand
- Only dynamic HTML in React, because:
- A plain html file is most likely to render the DOM successfully, so even if the React app scripts have an issue you’ll still render the rest of the page
- From an efficiency perspective, is an HTML file faster to load than React rendering?
I know this is similar to this question, but the one answer didn’t really address the "why". How much static HTML should I serve with React?