Skip to content
This repository was archived by the owner on Feb 1, 2026. It is now read-only.

Commit 7765cae

Browse files
committed
fix: set new texture as initial value for textue loader
1 parent f12d7d5 commit 7765cae

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
},
7171
"devDependencies": {
7272
"@release-it/conventional-changelog": "^10.0.0",
73-
"@tresjs/core": "5.0.0-next.0",
73+
"@tresjs/core": "https://pkg.pr.new/@tresjs/core@be3280b",
7474
"@tresjs/eslint-config": "^1.4.0",
7575
"@types/node": "^22.10.5",
7676
"@types/three": "^0.172.0",

playground/vue/src/pages/loaders/use-texture/TheExperience.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ watch(isLoading, (newIsLoading) => {
1616
if (newIsLoading) {
1717
state.hasFinishLoading = false
1818
}
19-
})
19+
}, { immediate: true })
2020
2121
watch(texture, (newTexture) => {
2222
console.log('texture', newTexture)
2323
setTimeout(() => {
2424
state.hasFinishLoading = true
2525
}, 1000)
26-
})
26+
}, { immediate: true })
2727
</script>
2828

2929
<template>

pnpm-lock.yaml

Lines changed: 15 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { useLoader } from '@tresjs/core'
2-
import { TextureLoader } from 'three'
2+
import { Texture, TextureLoader } from 'three'
33
import type { MaybeRef } from 'vue'
44

55
export function useTexture(path: MaybeRef<string>) {
6-
const result = useLoader(TextureLoader, path)
6+
const result = useLoader(TextureLoader, path, {
7+
initialValue: new Texture(),
8+
})
79

810
return result
911
}

0 commit comments

Comments
 (0)