Skip to content

Commit c16c6e5

Browse files
0x-jerryalvarosabu
andauthored
fix: build dts error TS7056 (Tresjs#521)
Co-authored-by: Alvaro Saburido <[email protected]>
1 parent efdde6d commit c16c6e5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/core/controls/CameraControls.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
Vector3,
1515
Vector4,
1616
} from 'three'
17-
import { computed, onUnmounted, ref, toRefs, watch, watchEffect } from 'vue'
17+
import { computed, onUnmounted, shallowRef, toRefs, watch, watchEffect } from 'vue'
1818
import type { TresControl } from '@tresjs/core'
1919
import type {
2020
Camera,
@@ -402,7 +402,7 @@ const touches = computed(() => getTouches(
402402
props.touches,
403403
))
404404
405-
const controlsRef = ref<TresControl & CameraControls | null>(null)
405+
const controlsRef = shallowRef<TresControl & CameraControls | null>(null)
406406
extend({ CameraControls })
407407
408408
watchEffect(() => {

src/core/controls/MapControls.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { useLoop, useTresContext } from '@tresjs/core'
33
import { useEventListener } from '@vueuse/core'
44
import { MapControls } from 'three-stdlib'
5-
import { onUnmounted, ref, toRefs, watch } from 'vue'
5+
import { onUnmounted, shallowRef, toRefs, watch } from 'vue'
66
import type { TresVector3 } from '@tresjs/core'
77
import type { Camera } from 'three'
88
@@ -281,7 +281,7 @@ watch(props, () => {
281281
invalidate()
282282
})
283283
284-
const controlsRef = ref<MapControls | null>(null)
284+
const controlsRef = shallowRef<MapControls | null>(null)
285285
286286
extend({ MapControls })
287287

src/core/controls/OrbitControls.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useLoop, useTresContext } from '@tresjs/core'
33
import { useEventListener } from '@vueuse/core'
44
import { TOUCH } from 'three'
55
import { OrbitControls } from 'three-stdlib'
6-
import { onUnmounted, ref, toRefs, watch } from 'vue'
6+
import { onUnmounted, shallowRef, toRefs, watch } from 'vue'
77
import type { TresVector3 } from '@tresjs/core'
88
import type { Camera } from 'three'
99
@@ -282,7 +282,7 @@ const {
282282
283283
const { camera: activeCamera, renderer, extend, controls, invalidate } = useTresContext()
284284
285-
const controlsRef = ref<OrbitControls | null>(null)
285+
const controlsRef = shallowRef<OrbitControls | null>(null)
286286
287287
extend({ OrbitControls })
288288

0 commit comments

Comments
 (0)