useTexture causing a blank 'redraw' but not a 'rerender' on Canvas #1235
Replies: 3 comments 3 replies
-
I wonder if this (#871) is related. But I just tried v9.6.0 and the same issue occurs. |
Beta Was this translation helpful? Give feedback.
-
that is how suspense works, it really is worth it to learn suspense, it enables many interesting things. first of all, if a component suspends, everything within the same bound is unmounted by design, that allows you to wrap individual things in a suspense bound. then there is startTransition, which allows things to persist on screen until the new result comes in. i would make an example with your code but i have no faith in it, there are things there that look suspect to me. the way you use useTexture for instance, then you mutate into a prop, it all seems confused tbh. |
Beta Was this translation helpful? Give feedback.
-
We've managed to get this seamless switch with |
Beta Was this translation helpful? Give feedback.
-
Example here -
https://codesandbox.io/s/shoe-configurator-forked-37us32?file=/src/App.js
Based on the shoe configurator, if you click on the shoe it will switch the Mesh with new TextureMap. While it's loading the textures, the screen goes blank, but it doesn't seem to be effecting the whole Canvas, as the parents timestamp is identical.
My assumption is that it would 1. click, 2. load, 3. render.
Am I potentially implementing this incorrectly? Or is this a bug? Am I able to preload my texture to avoid this?
Note: it's only relevant for the first load, subsequent loads are instant, but I've added a count to trigger it over and over.
This could be a possible duplicate - #1165
Beta Was this translation helpful? Give feedback.
All reactions