React, ASP.NET Core and SEO

Wednesday, July 11, 2018

I just recently completed the Pluralsight training course Building a Website with React and ASP.NET Core. It was a great course, and taught a lot about getting the two to work together. What struck me is how limited they are in their interactions together. Some takeaways:

  • Server Side Rendering (SSR) is vital for Search Engine Optimization (SEO), a critical requirement for the Spirits Wiki platform we're building.
  • React on the server does SSR, but so does ASP.NET. However, to get React to do SSR, you have to build the React server side infrastructure manually.
  • ASP.NET's function for client and server side rendering is that of the API layer, and pretty much nothing else.
  • You don't get SSR out of the box with the create-react-app, the amazing React starter kit tool. In fact, you pretty much have to 'break' CRA in order to get SSR to work, thereby making it pointless (more or less) to use CRA with your app.

For .NET developers looking to migrate, it doesn't appear that moving into React SSR gives you a lot of benefits - especially with all of the performance and scaling features and improvements in ASP.NET Core. Indeed - unless you were highly comfortable with 'full stack' NodeJS development, and security isn't a big requirement, I'd say there isn't much reason to move into it - on the server side, that is. For client-side features, it may be another story...