ReactJS.NET
React ♥ C# and ASP.NET MVC

ReactJS.NET makes it easier to use Facebook's React and JSX from C# and other .NET languages, focusing specifically on ASP.NET MVC (although it also works in other environments). It assumes you already have some basic knowledge about React. It is cross-platform and can run on Linux via Mono. Take a look at the tutorial to see how easy it is to get started with React and ReactJS.NET!

Latest news: ReactJS.NET 1.1.2 - Better errors messages and namespaced JSX (September 14, 2014)

On-the-fly JSX to JavaScript compilation

Simply name your file with a .jsx extension and link to the file via a script tag.

The files will automatically be compiled to JavaScript and cached server-side. No precompilation required. Perfect for development.

// /Scripts/HelloWorld.jsx
var HelloWorld = React.createClass({
  render: function() {
    return <div>Hello world!</div>;
  }
});
<!-- Reference it from HTML -->
<script src="@Url.Content("~/Scripts/HelloWorld.jsx")"></script>

JSX to JavaScript compilation via popular minification/combination libraries

Use Cassette or ASP.NET Minification and Combination? ReactJS.NET's got you covered.

Reference your JSX files and they will be included in your bundles along with your other JavaScript files.

// In BundleConfig.cs
bundles.Add(new JsxBundle("~/bundles/main").Include(
    // Add your JSX files here
    "~/Scripts/HelloWorld.jsx",
    "~/Scripts/AnythingElse.jsx",
    // You can include regular JavaScript files in the bundle too
    "~/Scripts/ajax.js",
));
<!-- In your view -->
@Scripts.Render("~/bundles/main")

Server-side component rendering

Pre-render the initial state of your React components server-side to make the initial load feel faster.

<!-- This will render the component server-side -->
@Html.React("CommentsBox", new {
    initialComments = Model.Comments
})

<!-- Initialise the component in JavaScript too -->
<script src="http://fb.me/react-0.11.1.min.js"></script>
@Scripts.Render("~/bundles/main")
@Html.ReactInitJavaScript()