Skip to content

Commit

Permalink
fix: manually triggering render ref on constructor params change
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Aug 19, 2023
1 parent 4605fdf commit d3014a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/composables/useRenderer/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Color, WebGLRenderer } from 'three'
import { rendererPresets, RendererPresetsType } from './const'
import { shallowRef, watchEffect, onUnmounted, type MaybeRef, computed, watch, ShallowRef } from 'vue'
import { shallowRef, watchEffect, onUnmounted, type MaybeRef, computed, watch, ShallowRef, triggerRef } from 'vue'
import {
toValue,
unrefElement,
Expand Down Expand Up @@ -141,6 +141,7 @@ export function useRenderer(
watch(webGLRendererConstructorParameters, () => {
renderer.value.dispose()
renderer.value = new WebGLRenderer(webGLRendererConstructorParameters.value)
triggerRef(renderer)
})

watchEffect(() => {
Expand Down

0 comments on commit d3014a4

Please sign in to comment.