fivem-react-boilerplate-lua icon indicating copy to clipboard operation
fivem-react-boilerplate-lua copied to clipboard

Question: How to send data with no NUI callback

Open Rasinzz opened this issue 2 years ago • 1 comments

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?

Rasinzz avatar Jul 04 '23 16:07 Rasinzz

Client: SendReactMesssage("speed", speed) UI: useNuiEvent("speed",(speed) => {setSpeed(speed})

scamvonat avatar Aug 06 '23 18:08 scamvonat