# react-to-angular

> Library for embedding React components in Angular.

Latest version **0.1.2** (published 2018-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-to-angular
pnpm add react-to-angular
yarn add react-to-angular
bun add react-to-angular
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-03-03 |
| First published | 2018-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | timhwang21 |

## Links

- npm: https://www.npmjs.com/package/react-to-angular
- npm.io page: https://npm.io/package/react-to-angular

## Recent versions

- 0.1.2 (latest) — 2018-03-03
- 0.1.1 — 2018-02-01

## README

# React To Angular

Library for embedding React components in Angular.

Provides a component that takes a React component and a props object as input.

## Usage

```javascript
// app.component.tsx
import * as React from 'react';

@Component({
  selector: "app-component",
  template: `
    <r2a-react-wrapper
      [props]="myProps"
      [component]="myComponent"
    >
    </r2a-react-wrapper>
  `,
))
export class MyComponent {
  // be sure to enable .tsx parsing; if not, use React.createElement()
  myComponent: any = props => <div>{props.value}</div>;
  myProps: any = {
    value: 'I am a React component!',
  };
}
```

See `src/app/app.component.ts` for usage examples.

## Example

```bash
yarn install
yarn start
```

## Building

This project uses `ng-packagr` to bundle the module. `yarn build` will instead bundle the entire repository, including the demo app.

```bash
yarn packagr
```

## Release

For now, it is manual. PRs welcome to implement an actual release process.

1. Increment version number in `package.json`
2. `yarn packagr && cd dist && npm publish`

## License

MIT

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