React.js with ASP.NET MVC 5
How to use React.js in asp.net mvc app, step by step tutorial
React.js is a JavaScript library for creating user interfaces by Facebook and Instagram. In this post, We will create a Hello World application and see how React.JS can be used with ASP.NET MVC 5. Here is the video tutorial of this post.
React.js
React is a UI library to create interactive and reusable UI components. It is considered as the V in MVC.
It allows you to create your own components (NOT Templates like in AngularJS) that you can later reuse, combine, and nest to your content. Thus it will boost your productivity.
React.js is based on a concept called the Virtual DOM that determines what changes need to be made in the DOM beforehand and updates the DOM tree accordingly. Thus it avoids costly DOM operations and makes updates in a very efficient manner.
It is so easy to define and manipulate your own components by using a special syntax called JSX (Optional), which allows you to mix HTML/XML with JavaScript.
Check out Instagram for an example of a fully React based application.
ReactJS.NET
ReactJS.NET makes it easier to use React and JSX in .NET applications. It provides On-the-fly JSX to JavaScript compilation, Supports ASP.NET Bundling and Minification and allows you to pre-render the initial state of your React components server-side to make the initial load feel faster.
Getting started
Software versions used in the tutorial:
Visual Studio 2012 .NET 4.5 ASP.NET MVC 5.0 React.js 0.12.2 ReactJS.NET 1.3
Comments