d7be1a4429537f80646d979aafe31de2bd265687
react2angular

The easiest way to use React components in Angular 1!
Installation
npm install react2angular --save
Usage
1. Create a React component
import { Component } from 'react'
interface Props {
fooBar: number
baz: string
}
interface State {...}
class MyComponent extends Component<Props, State> {
render() {
return <div>
<p>Foo: {this.props.fooBar}</p>
<p>Bar: {this.props.bar}</p>
</div>
}
...
}
Note: this example uses TypeScript, but it works just as well with vanilla JavaScript, ES6, Flow, etc.
2. Expose it to Angular
import { react2angular } from 'react2angular'
angular
.module('myModule', [])
.component('myComponent', react2angular(MyComponent, ['foo', 'bar']))
3. Use it in your Angular 1 code
<my-component
foo-bar="3"
baz="'foo'"
></my-component>
Tests
npm test
License
Apache2
Description
Languages
TypeScript
95.3%
JavaScript
4.7%