Skip to content

ReactDotNetCoreReact components as ASP.NET Core MVC views

Server-side rendered and hydrated — no Web API, no Next.js, no SPA. Keep your controllers, services, and view models; replace only the view layer.

Quick look

csharp
public IActionResult Detail(int id)
{
    var model = _userService.GetUser(id);     // unchanged domain code
    return this.ReactView<UserProfile>(model); // React instead of a Razor view
}
tsx
// Views/UserProfile.tsx
export default function UserProfile(props: UserDto) {
  return <h1>{props.name}</h1>;
}

Install both packages and you're ready:

bash
dotnet add package ReactDotNetCore.AspNetCore
npm install @react-dotnetcore/runtime react react-dom

Head to Getting Started for a full project setup.

Released under the MIT License.