adrien-f / hypernova-net

Sample application trying to render a React component with Airbnb's hypernova

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HypernovaNet

Sample project using Hypernova and ASP .NET Core to render server-side React components.

Running

docker-compose up

Example

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"/>

About

Sample application trying to render a React component with Airbnb's hypernova


Languages

Language:C# 93.2%Language:TypeScript 6.8%