Initial project import
This commit is contained in:
20
node_modules/@react-three/drei/core/AdaptiveEvents.js
generated
vendored
Normal file
20
node_modules/@react-three/drei/core/AdaptiveEvents.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as React from 'react';
|
||||
import { useThree } from '@react-three/fiber';
|
||||
|
||||
function AdaptiveEvents() {
|
||||
const get = useThree(state => state.get);
|
||||
const setEvents = useThree(state => state.setEvents);
|
||||
const current = useThree(state => state.performance.current);
|
||||
React.useEffect(() => {
|
||||
const enabled = get().events.enabled;
|
||||
return () => setEvents({
|
||||
enabled
|
||||
});
|
||||
}, []);
|
||||
React.useEffect(() => setEvents({
|
||||
enabled: current === 1
|
||||
}), [current]);
|
||||
return null;
|
||||
}
|
||||
|
||||
export { AdaptiveEvents };
|
||||
Reference in New Issue
Block a user