Using React for more than an intranet SPA application

Single Page Applications can be written in many ways with many frameworks, I have decided to concentrate on reading about React. In many cases, the standard application where an application is mounted in to a point in an almost empty html document is sufficient. I have previously written about the possibility to include a react app only in a part of a web site.

You should know that the standard SPA React app does not work well online, and server side rendering should be applied if you want to plan a web app based on React that is supposed to work online and get indexed by search engines. What you want is html to be served when the page loads – search engines read this and does not care to wait for JavaScript to populate the site.

Single Page Application written in React are popular in the IT industry and many projects I have seen is about creating an application for use internally in an organisation. It is then fine to use the boilerplate “create-react-app” and just write an API for the app. But if you are creating an online experience today you might want to look into server side rendering.

I have been struggling to find a good architecture but yesterday I found efforts online to server side render using PHP. I have seen efforts on node.js before but let’s face it – most web hotels use PHP and I feel that still using PHP perhaps with a framework is most suitable if you want your code to be reused or sold on a broad scale.

I will look into this more carefully by writing some example code if I have time. It turns out there is a PHPJsV8 extension and there are several ways of rendering React directly with PHP. With the extension installed in React-PHP-V8Js and there is also an effort from the Symfony community that seems not to need the extension called ReactRenderer.

One Reply to “Using React for more than an intranet SPA application”

Leave a Reply

Your email address will not be published. Required fields are marked *