Skip to content

Commit

Permalink
docs: add information about extending built-in types
Browse files Browse the repository at this point in the history
Signed-off-by: Trezy <[email protected]>
  • Loading branch information
trezy committed Jan 4, 2025
1 parent 2e0981d commit 8158b2b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,3 +435,17 @@ The prefixed and unprefixed elements have the same functionality, but we recomme

> [!IMPORTANT]
> Some components conflict with other libaries, such as `<svg>` in `react-dom` and `<color>` in `@react-three/fiber`. To address this the `pixi` prefixed elements are always available, even after injecting the unprefixed elements.

#### Extending Built-in Components

The props for built-in components are available on the `PixiElements` type and can be used to extend the built-in types.

```ts
import { type PixiElements } from '@pixi/react'

export type TilingSpriteProps = PixiElements['pixiTilingSprite'] & {
image?: string;
texture?: Texture;
};
```

0 comments on commit 8158b2b

Please sign in to comment.