UNPKG

react-native-filament

Version:

A real-time physically based 3D rendering engine for React Native

14 lines 388 B
import { useEffect } from 'react'; /** * A hook that "on mount" adds the entity to the scene, and "on unmount" removes it. */ export function useEntityInScene(scene, entity) { useEffect(() => { if (entity == null) return; scene.addEntity(entity); return () => { scene.removeEntity(entity); }; }, [entity, scene]); } //# sourceMappingURL=useEntityInScene.js.map