Files
2026-07-13 12:38:36 +08:00

34 lines
764 B
Markdown

## Examples
##### Simple Component
Create a component named `MyComponent` at `libs/ui/src/my-component.tsx`:
```shell
nx g @nx/react:component libs/ui/src/my-component.tsx
```
##### With a Different Symbol Name
Create a component named `Custom` at `libs/ui/src/my-component.tsx`:
```shell
nx g @nx/react:component libs/ui/src/my-component.tsx --name=custom
```
##### Omitting the File Extension
Create a component named `MyComponent` at `libs/ui/src/my-component.tsx` without specifying the file extension:
```shell
nx g @nx/react:component libs/ui/src/my-component
```
##### Class Component
Create a class component named `MyComponent` at `libs/ui/src/my-component.tsx`:
```shell
nx g @nx/react:component libs/ui/src/my-component --classComponent
```