Closed mrboots123 closed 6 months ago
Unable to create basic example using docs, rendering a custom component causes an error.
Renders a graphics correctly instead of erroring out
`import {Stage,PixiComponent} from '@pixi/react';
import '@pixi/particle-emitter' import * as PIXI from 'pixi.js';
const Circle = PixiComponent('Circle', { create: props => new PIXI.Graphics(),
applyProps: (instance, oldProps, newProps) => { instance.clear(); instance.lineStyle(4, 0xffd700, 1); instance.beginFill(0x000000, 0); instance.drawRoundedRect(100, 100, 50, 50, 5); instance.endFill(); }
});
const App = () => { return ( <Stage width={500} height={500} options={{ autoDensity: true, backgroundColor: 0x012b30 }}>
</Stage>
); };
export default App;`
@pixi/react
pixi.js
React
ReactDOM
No response
closing this issue, solution was version 8 was not supported, downgrading to 7 makes it work
Current Behavior
Unable to create basic example using docs, rendering a custom component causes an error.
Expected Behavior
Renders a graphics correctly instead of erroring out
Steps to Reproduce
`import {Stage,PixiComponent} from '@pixi/react';
import '@pixi/particle-emitter' import * as PIXI from 'pixi.js';
const Circle = PixiComponent('Circle', { create: props => new PIXI.Graphics(),
});
const App = () => { return ( <Stage width={500} height={500} options={{ autoDensity: true, backgroundColor: 0x012b30 }}>
); };
export default App;`
Environment
@pixi/react
version: e.g. 7.1.2pixi.js
version: e.g. 8.0.2React
version: e.g. 18.0.0ReactDOM
version: e.g. 18.0.0Possible Solution
No response
Additional Information
No response