Installation
# Using Yarn: yarn add react-in-angular1 react react-dom # Or, using NPM: npm install react-in-angular1 react react-dom --save
Usage
1. Create a React component
{ return <div> <p>FooBar: thispropsfooBar</p> <p>Baz: thispropsbaz</p> </div> }
2. Expose it to Angular
angular
3. Use it in your Angular 1 code
Dependency Injection
It's easy to pass services/constants/etc. to your React component: just pass them in as the 3rd argument, and they will be available in your component's Props. For example:
state = data: '' { thisprops$http } { return <div> thispropsFOO thisstatedata </div> } angular
Note: If you have an injection that matches the name of a prop, then the value will be resolved with the injection, not the prop.