Best of both worlds!
https://github.com/Microsoft/angular-react
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nec metus justo. Aliquam erat volutpat.
src: https://dzone.com/storage/temp/9807927-component-lifecycle.jpg
src: https://i.stack.imgur.com/SQBU6.png
Replacement for default AngularBrowser module
React aware
Capable of loading React components
Shadow DOM aware
Managing react component lifecycle inside Angular component lifecycle
class Toggle extends React.Component {
constructor(props) {
super(props);
this.state = { isToggleOn: true };
// This binding is necessary to make `this` work in the callback
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
this.setState(state => ({
isToggleOn: !state.isToggleOn
}));
}
render() {
return React.createElement(
'button',
{ onClick: this.handleClick },
this.state.isToggleOn ? 'ON' : 'OFF'
);
}
}
ReactDOM.render(React.createElement(Toggle, null), document.getElementById('root'));