Custom Components
Custom components are supported via the extend
API. For example, you can create a <viewport>
component using the pixi-viewport
library:
import {
Application,
extend,
} from '@pixi/react';
import { Viewport } from 'pixi-viewport';
extend({ Viewport });
const MyComponent = () => (
<Application>
<pixiViewport>
<pixiContainer />
</pixiViewport>
</Application>
);
The extend
API will teach @pixi/react
about your components, but TypeScript won't know about them nor their props. If you're using Typescript, check out our docs for Typescript Users.