jimmyhoran / React.NET

.NET library for JSX compilation and server-side rendering of React components

Home Page:http://reactjs.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReactJS.NET

ReactJS.NET is a library that makes it easier to use Babel along with Facebook's React and JSX from C#.

Build status  NuGet version

Features

Quick Start

Install the package

Install-Package React.Web.Mvc4 # For ASP.NET MVC 4 or 5
Install-Package React.AspNet   # For ASP.NET MVC Core 1.0

Create JSX files

// /Scripts/HelloWorld.jsx
var HelloWorld = React.createClass({
    render: function () {
        return (
            <div>Hello {this.props.name}</div>
        );
    }
});

Reference the JSX files from your HTML

<script src="@Url.Content("~/Scripts/HelloWorld.jsx")"></script>

Now you can use the HelloWorld component.

For information on more advanced topics (including precompilation and server-side rendering), check out the documentation

Building Manually and Contributing

When building your own copy of ReactJS.NET (for example, if implementing a new feature or fixing a bug), your first build always needs to be done using the build script (dev-build.bat) as this generates a few files required by the build (such as SharedAssemblyVersionInfo.cs). Once this build is completed, you can open React.sln in Visual Studio and compile directly from Visual Studio. Please refer to the documentation page on contributing for more information on contributing to ReactJS.NET.

Note that the build requires you to have Git installed. If you do not want to install Git, you may remove the GitVersion task from build.proj.

About

.NET library for JSX compilation and server-side rendering of React components

http://reactjs.net/

License:Other


Languages

Language:C# 87.7%Language:CSS 4.8%Language:JavaScript 4.6%Language:HTML 1.5%Language:Ruby 0.4%Language:PowerShell 0.4%Language:Nginx 0.2%Language:Pascal 0.2%Language:Batchfile 0.1%Language:ASP 0.1%