# @ardentcode/omni-router-react

> Additional package for Omni Router with processor rendering react components

Latest version **0.1.1** (published 2022-10-21) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install @ardentcode/omni-router-react
pnpm add @ardentcode/omni-router-react
yarn add @ardentcode/omni-router-react
bun add @ardentcode/omni-router-react
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-10-21 |
| First published | 2022-10-21 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | ArdentCode |
| Maintainers | andrzeem90, lukjaki, majo44, krzysztof-cislo, ownelek |

## Links

- npm: https://www.npmjs.com/package/@ardentcode/omni-router-react
- Repository: https://github.com/ardentcode/omni-router
- Homepage: https://github.com/ardentcode/omni-router/tree/main/packages/omni-router-react
- Issues: https://github.com/ardentcode/omni-router/issues
- npm.io page: https://npm.io/package/@ardentcode/omni-router-react

## Recent versions

- 0.1.1 (latest) — 2022-10-21
- 0.1.0 — 2022-10-21

## README

# 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.

```typescript jsx
createReactRouteProcessor({
    reactRoot: createRoot(rootElement),
    renderComponent: (node: ReactNode) => <Wrapper>{node}</Wrapper>,
    renderError: (error: unknown) => <ErrorView error={error}>
});
```

```typescript jsx
async function homeRouteHandler(params: HomeRouteParams): Promise<ReactRouteData> {
    return {
        react: {
            component: <HomeView/>
        }
    };
}
```

---
_Source: https://npm.io/package/@ardentcode/omni-router-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
