You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// example setup to cause props to change after 1 secondfunctionuseLightingDelay(){const[lighting,setLighting]=useState(true);useEffect(()=>{consttimer=setTimeout(()=>{setLighting(false);},1000);return()=>clearTimeout(timer);});returnlighting;}// example terrain (same class as default terrain, but obviously a fresh instance)// createWorldTerrainAsync() also has the same behavior if you want to test with promises.constterrain=newEllipsoidTerrainProvider();// after update, globe disappears, leaving only atmospheric effectsfunctionBreaks(){constlighting=useLightingDelay();return(<Viewer><GlobeenableLighting={lighting}/></Viewer>);}// after update, globe disappears, leaving only atmospheric effectsfunctionAlsoBreaks(){constlighting=useLightingDelay();return(<ViewerterrainProvider={terrain}><GlobeenableLighting={lighting}/></Viewer>);}// after update, globe disappears until terrain is recalculatedfunctionFlashes(){constlighting=useLightingDelay();return(<Viewer><GlobeenableLighting={lighting}terrainProvider={terrain}/></Viewer>);}// after update nothing happens (other than lighting being disabled).// this is what I would expect to happen for both examples abovefunctionWorkaround(){constlighting=useLightingDelay();return(<ViewerterrainProvider={terrain}><GlobeenableLighting={lighting}terrainProvider={terrain}/></Viewer>);}
Reporoduction:
I believe this is due to the unconditional assignment at https://github.com/reearth/resium/blob/main/src/Globe/Globe.ts#L119 .
But I don't understand why it doesn't apply on the first render.
The text was updated successfully, but these errors were encountered: