12

I have worked in ASP.NET CORE MVC, before.

  • What are all the advantages in using ReactJS over ASP.NET CORE?
  • Would not that additional library & its components, slow down the page load, comparing plain Razor Views?

I tried web search, I am unable to get proper answers.

1
  • 4
    We used ReactJS to replace MVC, rather than work with it. We use ASP.Net Core to provide an API and server-side functionality. Then we have ReactJS handle the client side as a Single Page Application. So we still use ASP.Net Core, we just don't use MVC. Commented Jan 10, 2019 at 11:56

2 Answers 2

13

If you have independent apps in PC,Phones tablet,etc,you could just use React and core web api which is front-end and back-end separation.

By using Angular/React with api in server side:

  1. You eliminate process of generating HTML in server side and you save CPU.

  2. API produces small payload (json) and Razor (html) would be much larger in size, constant full page reloads and postback round trip. so API and SPA save bandwidth.

  3. API and SPA could have different versioning, scaling and deployment scenarios.

  4. By using API you can support mobile app too and if you start by Razor you may need api in future.

Below are some opinions on using Angular/React or razor:

  1. Razor supports mobile,and both are optimized and fast in their own way. Razor optimizes code by not using a tree like MVC does. React is client side so it doesn't really use a tree, but also optimizes data in the HTML to an extent.

  2. Angular (or React) is far superior in terms of performance.The model-binding aspects of Angular is a gigantic advantage of server-side rendering. Using Razor(or server side rendering in general) does, however, lend itself to better overall integrity as far as data goes and it makes for a better transition of data from front-end to back-end.

See ASP.NET Core 2.0 Razor vs Angular/React/etc

Sign up to request clarification or add additional context in comments.

Comments

7

What are all the advantages in using ReactJS over ASP.NET CORE?

ReactJS is high performance and rapid development client side framework, you can use it throw asp.net core or any other server side framework to handle client side operations.

Would not that additional library & its components, slow down the page load, comparing plain Razor Views?

ReactJS designed to be a single page application, and this kind of apps is more faster than multiple page applications, also ReactJS processing the DOM in different and smarter way.

If you want to use ReactJS in asp.net core you must keep in mind that asp.net core is the api part just to return the data (json or xml) or to receive your ajax request to post data.

All clients side parts will handled by ReactJS, no razor views, you can have only one to reference your reacts application or simply you can reference it using plain html page.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.