@ardentcode/omni-router-react
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Omni Router React

Additional package to Omni Router, which can be used while working with React application. It contains only a processor used for rendering react components. For details of Omni Router please see https://github.com/ardentcode/omni-router/tree/main/packages/omni-router

Build & Development

To install and build, please run following commands:

  • npm install
  • npm run build

For development, you can use:

  • npm run watch

Usage

React processor renders react components in specified react root.

createReactRouteProcessor({
    reactRoot: createRoot(rootElement),
    renderComponent: (node: ReactNode) => <Wrapper>{node}</Wrapper>,
    renderError: (error: unknown) => <ErrorView error={error}>
});
async function homeRouteHandler(params: HomeRouteParams): Promise<ReactRouteData> {
    return {
        react: {
            component: <HomeView/>
        }
    };
}

/@ardentcode/omni-router-react/

    Package Sidebar

    Install

    npm i @ardentcode/omni-router-react

    Weekly Downloads

    9

    Version

    0.1.1

    License

    CC0-1.0

    Unpacked Size

    12.3 kB

    Total Files

    10

    Last publish

    Collaborators

    • lukjaki
    • majo44
    • krzysztof-cislo
    • ownelek