@ngeenx/ngx-react
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@ngeenx/ngx-react", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Embed React components in Angular projects", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -5,3 +5,7 @@ # ngx-react | ||
> [!WARNING] | ||
> This package is experimental. There may be possible performance problems, memory leaks and similar problems. It is your responsibility to use it. | ||
## [Play on StackBlitz ⚡️](https://stackblitz.com/~/github.com/ngeenx/ngx-react) | ||
## 📦 Installation | ||
@@ -23,2 +27,5 @@ | ||
> [!NOTE] | ||
> Addionaly, you can install `@types/react` and `@types/react-dom` for TypeScript support. | ||
## 🚀 Usage | ||
@@ -41,4 +48,17 @@ | ||
### 2. Create React Component | ||
### 2. Update `tsconfig.json` | ||
Add the following to your `tsconfig.json` file to allow importing `.tsx` files in Angular Project. | ||
```json | ||
{ | ||
"compilerOptions": { | ||
"jsx": "react", | ||
... | ||
} | ||
} | ||
``` | ||
### 3. Create React Component | ||
Create a wrapper component for your React component. We will use this component to pass props to the React component. | ||
@@ -51,4 +71,4 @@ | ||
const ReactApp: FC<any> = () => { | ||
const [inputValue, setInputValue] = useState(''); | ||
const ReactApp: FC<any> = ({ initialInputValue }: any) => { | ||
const [inputValue, setInputValue] = useState(initialInputValue); | ||
@@ -78,3 +98,3 @@ const handleChange = (event: any) => { | ||
### Basic Usage | ||
### 4. Import in Angular Component | ||
@@ -98,4 +118,6 @@ ```typescript | ||
public ReactApp: typeof ReactApp = ReactApp; | ||
public props: any = {} | ||
public props = { | ||
initialInputValue: "Some Value" | ||
} | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16742
12
118