What is the prefered way to build websites with lots of static content?


(Tim Navrotskyy) #1

Many projects, I work on, have lots of static content. Those are pages like “About Us”, “Our Team”, landing pages with just a couple of buttons and so on. At the same time, those pages have many dynamic components, which are a great fit for React and Virtual DOM.

  1. How do you structure those projects?
  2. Is there are boilerplate or an example project for this kind of projects?

(Mikayel) #2

I will recommend to use Composite View Pattern.


(Tim Navrotskyy) #3

Thank you for this advice. As far as I understand the all static HTML is written using React components and JSX. Is there a way to avoid it and use plain HTML and CSS? The reason I am asking is that those static parts don’t have to be Virtual DOM based and React adds unnecessary complexity.


(Mikayel) #4

Config your router to use static content for regular (none React) pages, and for rest you can use single page React app.


(Andy Edwards) #5

Just FYI, you might be interested in using Phenomic or Gatsby to build the static pages from React JSX. It would enable you to use the same components in your static and dynamic pages, so that you get the same look and feel in both without having all the unnecessary complexity in the generated static pages.