New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bubblydoo/angular-react

Package Overview
Dependencies
Maintainers
0
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bubblydoo/angular-react - npm Package Compare versions

Comparing version 0.4.4 to 0.4.5

2

package.json
{
"name": "@bubblydoo/angular-react",
"version": "0.4.4",
"version": "0.4.5",
"license": "MIT",

@@ -5,0 +5,0 @@ "author": "Hans Otto Wirtz <hansottowirtz@gmail.com>",

@@ -208,3 +208,3 @@ <a href="https://www.npmjs.com/package/@bubblydoo/angular-react" alt="NPM">

[ngTemplateOutletInjector]="injector"
></ng-template>
></ng-container>
</div>

@@ -308,4 +308,38 @@ `,

## Usage notes
### `this` is undefined when passing an Angular component method as a React prop
Angular component methods are always called with the component instance as `this`. When you pass an Angular method as a prop to a React component, `this` will be `undefined`.
```ts
@Component({
template: `<react-wrapper [component]="Button" [props]="{ onClick }">`
})
class AppComponent {
Button = Button
onClick() {
console.log(this) // undefined
}
}
```
You can fix it as follows:
```ts
@Component({
template: `<react-wrapper [component]="Button" [props]="{ onClick }">`
})
class AppComponent {
Button = Button
onClick = () => {
console.log(this) // AppComponent instance
}
}
```
## Further reading
See this blog post for the motivation and more details: [Transitioning from Angular to React, without starting from scratch](https://dev.to/bubblydoo/transitioning-from-angular-to-react-without-starting-from-scratch-j66)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc