Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bubblydoo/angular-react

Package Overview
Dependencies
Maintainers
4
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.0.19 to 0.1.1

2

lib/angular-wrapper-with-module/angular-wrapper-with-module.d.ts

@@ -11,3 +11,3 @@ import * as ng from "@angular/core";

children?: any;
} & React.RefAttributes<HTMLElement>>;
} & React.RefAttributes<ng.ComponentRef<any>>>;
export default _default;

@@ -0,1 +1,2 @@

import { type ComponentRef } from '@angular/core';
import React from 'react';

@@ -9,3 +10,3 @@ declare const _default: React.ForwardRefExoticComponent<{

children?: any;
} & React.RefAttributes<HTMLElement>>;
} & React.RefAttributes<ComponentRef<any>>>;
export default _default;
{
"name": "@bubblydoo/angular-react",
"version": "0.0.19",
"version": "0.1.1",
"license": "MIT",

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

@@ -124,2 +124,37 @@ # React in Angular and Angular in React

### Refs
You can get a ref to the Angular component instance as follows:
```tsx
import { ComponentRef } from '@angular/core';
const ref = useRef<ComponentRef<any>>();
<AngularWrapper ref={ref} />;
```
To get a reference to the Angular component's HTML element, use `ref.location.nativeElement`.
To forward a ref to a React component, you can simply use the props:
```tsx
const Message = forwardRef((props, ref) => {
return <div ref={ref}>{props.message}</div>;
});
@Component({
template: `<react-wrapper [component]="Message" [props]="{ ref, message }">`
})
export class MessageComponent {
Message = Message;
message = 'hi!';
ref(div: HTMLElement) {
div.innerHTML = 'hi from the callback ref!';
}
}
```
## Developing

@@ -126,0 +161,0 @@

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

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