Basic setup
Pixi.js requires disabling its internal ticker and using Helios for frame updates.React integration
For React applications, manage Pixi.js lifecycle in auseEffect hook.
Custom React hook
Create a reusable hook to sync with Helios frames:Critical patterns
Disable Pixi.js ticker
Pixi.js has an internal ticker for animations. Don’t use it with Helios:Use Helios time for animations
Calculate all animations fromstate.currentFrame or state.currentTime:
Async initialization
Pixi.js v8+ requires async initialization. Always awaitapp.init():
Performance considerations
Sprite batching
Pixi.js automatically batches sprites with the same texture. Keep sprites using the same texture together:Graphics objects
ReuseGraphics objects instead of recreating them each frame:
Texture management
Preload textures and dispose of them when done:Canvas resolution
Set resolution based on your export target:Filters and effects
Filters are GPU-intensive. Use sparingly:Package dependencies
Common issues
Canvas not appearing
Ensure you await Pixi.js initialization and append the canvas:Animation stuttering
Verify Helios is properly bound and you’re not mixing ticker with Helios:Memory leaks in React
Always destroy the Pixi.js app on unmount:Blurry graphics
SetautoDensity and match device pixel ratio: