fivem-react-boilerplate-lua
fivem-react-boilerplate-lua copied to clipboard
Question: How to send data with no NUI callback
I made a vehicle hud that displays speed, gear and rpm when inside a vehicle. It doesn't have any buttons to click, so it doesn't use the native RegisterNUICallback at all. I was wondering how I can send data (such as speed, gear, etc.) back to React from the client-sided Lua code?
Client: SendReactMesssage("speed", speed) UI: useNuiEvent("speed",(speed) => {setSpeed(speed})