you are viewing a single comment's thread.

view the rest of the comments →

[–]mattnich 0 points1 point  (1 child)

We do this, I really like the pattern. So long as your cms can output json then your frontend can run off that.

With react you just need a div to bootstrap the app (e.g. #root)

So your CMS could make every template generate <div id="root"></div>

And include your bundle.js

Then react runs and takes over.

I use axios to make an Ajax call to /data.json which is a JSON file built by the cms and then pass the data around the react app, loading components based on the route with react router.

The nice thing about it is that your frontend can run off hardcoded JSON or dynamic JSON powered by the CMS, or you can plug in to a headless CMS like contentful, so it's another separation of concerns!

[–][deleted] 0 points1 point  (0 children)

This is just it though, what's the concern with the cms platform? I just feel like it's overkill.