Sample project using Hypernova and ASP .NET Core to render server-side React components.
docker-compose up
Currently it uses a tag helper.
import * as React from "react";
import {renderReact} from "hypernova-react"
interface HelloWorldProps {
from: string;
}
export class HelloWorldComponent extends React.Component<HelloWorldProps, {}> {
render() {
return <h1>Hello World, from {this.props.from}!</h1>
}
}
export default renderReact('HelloWorld', HelloWorldComponent);
services.AddSingleton<IHypernovaClient>(new HypernovaClient(new HypernovaConfig
{
Endpoint = "http://127.0.0.1:3000"
}));
<hypernova component="HelloWorld" data="@Model.HelloWorldData"/>