import React, { useState } from "react"; import "./App.css"; import { debugData } from "../utils/debugData"; import { fetchNui } from "../utils/fetchNui"; // This will set the NUI to visible if we are // developing in browser debugData([ { action: "setVisible", data: true, }, ]); interface ReturnClientDataCompProps { data: unknown; } const ReturnClientDataComp: React.FC = ({ data, }) => ( <>
Returned Data:
      {JSON.stringify(data, null)}
    
); interface ReturnData { x: number; y: number; z: number; } const App: React.FC = () => { const [clientData, setClientData] = useState(null); const handleGetClientData = () => { fetchNui("getClientData") .then((retData) => { console.log("Got return data from client scripts:"); console.dir(retData); setClientData(retData); }) .catch((e) => { console.error("Setting mock data due to error", e); setClientData({ x: 500, y: 300, z: 200 }); }); }; return (

This is the NUI Popup!

Exit with the escape key

{clientData && }
); }; export default App;