Hugo with React?

J. E picture J. E · Nov 15, 2018 · Viewed 7k times · Source

Is it possible/ideal to use something like Hugo with React? I am aware of Gatsby, but would Hugo work as well. I have limited knowledge of combining the two but my understanding would be that Hugo would be used for all your templating and static web pages and then React would be used for the web application type of things, and a headless CMS somewhere in there? Can someone with experience comment why Hugo or Gatsby are sometimes good to use with React? Or an overview of the relationship between the frameworks?

Answer

AmirHossein picture AmirHossein · Dec 7, 2018

Yeah,
There is component web design in gatsby,
And there is the light speed of hugo,

I am stuck in the decision between these too.

I dont know what I will do but what is on my mind is this:

  1. Use gatsby to build the page. You should build each page of your website on its own (dont rely on the routing)
  2. Use the index.html file with hugo templates.
  3. Done

This is the picture of folder public (the output) after building gatsby page:
enter image description here

Update:

You can rely on the routing. In the picture above, each of the component folders have index.html of its own so you can use them too.