Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to send data with no NUI callback #77

Open
Rasinzz opened this issue Jul 4, 2023 · 1 comment
Open

Question: How to send data with no NUI callback #77

Rasinzz opened this issue Jul 4, 2023 · 1 comment

Comments

@Rasinzz
Copy link

Rasinzz commented Jul 4, 2023

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?

@scamvonat
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants