Help getting on click handler to zoom in on coordinates

 const [position, setPosition] = useState(
    Cartesian3.fromDegrees(-74.0707383, 40.7117244, 100)
  );

  const pointGraphics = { pixelSize: 10 };

  const [issData, setIssData] = useState();

  useEffect(() => {
    getIssData().then((data) => {
      setIssData(data);
    });
  }, [issData]);

  let viewerRef = useRef(null);

  const issHandler = () => {
    if (viewerRef.current) {
      viewerRef.current.camera.flyTo({
        destination: position,
      });
    }
  };

  useEffect(() => {
    if (issData && viewerRef.current) {
      setPosition(
        Cartesian3.fromDegrees(
          Number(issData.iss_position.longitude),
          Number(issData.iss_position.latitude),
          420000
        )
      );
    }
  }, [issData]);

I cannot figure out how to add make the click handler go to the current point on the map, ive been struggling for hours and hoping someone can help me figure this out.

Whats happening first is im setting the useState at a default coordinate and than making the actual point that will appear, then making a use state for issData

Im then making the fetch to the data and logging it and using itself as a dependency to rerender the api every time it updates (which gives me the updating coordinates of the space stations)

then i initialize a viewerRef and thats where i dont understand whats going wrong. its not recognizing the flyTo properties or camera properties, if anyone has any idea i will love you forever