Comparing version 0.0.7 to 0.0.8
@@ -29,3 +29,4 @@ 'use strict'; | ||
camera = _useThree.camera, | ||
gl = _useThree.gl; | ||
gl = _useThree.gl, | ||
invalidate = _useThree.invalidate; | ||
@@ -37,2 +38,8 @@ reactThreeFiber.useFrame(function () { | ||
}); | ||
React.useEffect(function () { | ||
var _controls$current2, _controls$current3; | ||
(_controls$current2 = controls.current) == null ? void 0 : _controls$current2.addEventListener('change', invalidate); | ||
return (_controls$current3 = controls.current) == null ? void 0 : _controls$current3.removeEventListener('change', invalidate); | ||
}, [controls.current]); | ||
return /*#__PURE__*/React__default.createElement("orbitControlsImpl", _extends({ | ||
@@ -58,3 +65,4 @@ ref: mergeRefs([controls, ref]), | ||
camera = _useThree.camera, | ||
gl = _useThree.gl; | ||
gl = _useThree.gl, | ||
invalidate = _useThree.invalidate; | ||
@@ -66,2 +74,8 @@ reactThreeFiber.useFrame(function () { | ||
}); | ||
React.useEffect(function () { | ||
var _controls$current2, _controls$current3; | ||
(_controls$current2 = controls.current) == null ? void 0 : _controls$current2.addEventListener('change', invalidate); | ||
return (_controls$current3 = controls.current) == null ? void 0 : _controls$current3.removeEventListener('change', invalidate); | ||
}, [controls.current]); | ||
return /*#__PURE__*/React__default.createElement("mapControlsImpl", _extends({ | ||
@@ -68,0 +82,0 @@ ref: mergeRefs([controls, ref]), |
import _extends from '@babel/runtime/helpers/esm/extends'; | ||
import React, { forwardRef, useRef } from 'react'; | ||
import React, { forwardRef, useRef, useEffect } from 'react'; | ||
import { extend, useThree, useFrame } from 'react-three-fiber'; | ||
@@ -17,3 +17,4 @@ import { OrbitControls as OrbitControls$1, MapControls as MapControls$1 } from 'three/examples/jsm/controls/OrbitControls'; | ||
camera, | ||
gl | ||
gl, | ||
invalidate | ||
} = useThree(); | ||
@@ -25,2 +26,8 @@ useFrame(() => { | ||
}); | ||
useEffect(() => { | ||
var _controls$current2, _controls$current3; | ||
(_controls$current2 = controls.current) == null ? void 0 : _controls$current2.addEventListener('change', invalidate); | ||
return (_controls$current3 = controls.current) == null ? void 0 : _controls$current3.removeEventListener('change', invalidate); | ||
}, [controls.current]); | ||
return /*#__PURE__*/React.createElement("orbitControlsImpl", _extends({ | ||
@@ -41,3 +48,4 @@ ref: mergeRefs([controls, ref]), | ||
camera, | ||
gl | ||
gl, | ||
invalidate | ||
} = useThree(); | ||
@@ -49,2 +57,8 @@ useFrame(() => { | ||
}); | ||
useEffect(() => { | ||
var _controls$current2, _controls$current3; | ||
(_controls$current2 = controls.current) == null ? void 0 : _controls$current2.addEventListener('change', invalidate); | ||
return (_controls$current3 = controls.current) == null ? void 0 : _controls$current3.removeEventListener('change', invalidate); | ||
}, [controls.current]); | ||
return /*#__PURE__*/React.createElement("mapControlsImpl", _extends({ | ||
@@ -51,0 +65,0 @@ ref: mergeRefs([controls, ref]), |
{ | ||
"name": "drei", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "useful add-ons for react-three-fiber", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
@@ -5,4 +5,2 @@ [![Build Status](https://travis-ci.org/react-spring/drei.svg?branch=master)](https://travis-ci.org/react-spring/drei) [![npm version](https://badge.fury.io/js/drei.svg)](https://badge.fury.io/js/drei) ![npm](https://img.shields.io/npm/dt/drei.svg) | ||
<br /> | ||
yarn add drei | ||
@@ -14,4 +12,2 @@ | ||
<br /> | ||
### Exports | ||
@@ -25,5 +21,5 @@ | ||
### Contributions | ||
## Contributions | ||
**PR's are more than welcome!** If you find yourself repeating set-up code often and if it's generic enough to be useful, add it here, everyone benefits. | ||
If you find yourself repeating set-up code often and if it's generic enough, add it here, everyone benefits! | ||
@@ -34,2 +30,3 @@ ### Requirements | ||
- ForwardRefs if possible, so that objects can be referenced | ||
- Invalidate frames on any movement | ||
- Cleanup on unmount, no left-overs |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28279
490
29