There are several frameworks to choose from when building Single Page Applications (SPAs).

The 3 most popular are React, Vue, and Angular. To build SPAs with these three frameworks, JavaScript is required.

What happens when a developer is interested in building for the SPAs but doesn’t want to deal with the weirdness of JavaScript? Let’s find out.

Here comes Blazor

Blazor is a new Microsoft UI framework that uses a unique approach for leveraging C## .NET and the WebAssembly framework to create SPAs running in web browsers. It essentially allows a developer to build rich and interactive client-side applications with HTML, CSS, and C#.

On the other hand, we have React: a declarative, efficient, and flexible JavaScript library for building user interfaces and UI components.

React and Blazor share the similarity of being client-side frameworks/libraries for building rich and interactive modern client-side applications.

One thing that’s unique about Blazor is its JavaScript interoperability. This means a Blazor app can invoke JavaScript functions from .NET methods and .NET methods from JavaScript functions.

Blazor is made up of two major projects: Blazor WebAssembly (the client-side) and Blazor Server (the server-side). In this article, our focus will be comparing Blazor WebAssembly with React.

Before we dive deeper into things, let’s answer one pressing question.

C## running in the browser?

The big question here is, how does C## run in web browser? The technology that makes this possible is called WebAssembly, an open standard supported directly by current browsers on desktop and mobile platforms. You get to write C## code instead of regular JavaScript or React, and the compiled code runs natively in modern web browsers.

Getting started

In this article, we’ll explore how React and Blazor differ in the following areas:

  • Folder structure
  • Programming language
  • Templating
  • Performance
  • Ecosystem
  • Package manager
  • Communication between components
  • Routing
  • Dealing with HTTP

#blazor #react #javascript #web-development #dotnet

Blazor vs. React
2.35 GEEK