Replicating Homepage Demo

Hi,

I’m using Resium and Typescript, and I’d like to do something similar to the demo displayed on the homepage (also shown here: Cesium).

Here’s what I have so far:

 <Viewer
            animation={false}
            timeline={false}
            fullscreenButton={false}
            geocoder={false}
            homeButton={false}
            projectionPicker={false}
            baseLayerPicker={false}
            sceneModePicker={false}
            navigationHelpButton={false}
            ref={ref}
            height="100%"
            width="100%"
          >
            <ScreenSpaceCameraController enableZoom={false} />
            <Scene backgroundColor={new Color(0, 0, 0, 0)} />
            <Sun show={false} />
            <Moon show={false} />
            <SkyBox show={false} />
            <Globe
              enableLighting
            />
            <Clock
              startTime={JulianDate.fromIso8601("2013-06-25")}
              currentTime={JulianDate.fromIso8601("2013-06-25")}
              stopTime={JulianDate.fromIso8601("2013-06-26")}
              clockRange={ClockRange.LOOP_STOP} // loop when we hit the end time
              clockStep={ClockStep.SYSTEM_CLOCK_MULTIPLIER}
              multiplier={4950} // how much time to advance each tick
              shouldAnimate={true} // Animation on by default
              canAnimate={true}
              onTick={() => {
                console.log("tick")
                ref.current?.cesiumElement?.camera.rotateLeft(0.002);
              }}
            />
          </Viewer>

I’m having trouble with two things:
1.) onTick only occurs once after refreshing the page meaning the globe won’t rotate (only one “tick” is printed to console. However, if I save my index.tsx file, onTick starts working again and the globe starts rotating… any ideas on why this may be happening?

2.) It looks like the demo is using two baselayers; one for the daytime and one for the nighttime. How can I replicate this? I’d like to get a similar effect where the “earth at night” base layer is used on the side of earth that’s in darkness