A something, something
This repository is a
- K5 Documents - https://github.com/BTNGaming/k5_documents
- Ox_target - https://github.com/overextended/ox_target
SendReactMessage
Signature
---@param action string The action you wish to target
---@param data any The data you wish to send along with this action
SendReactMessage(action, data)
Usage
const MyComp: React.FC = () => {
const [state, setState] = useState('')
useNuiEvent<string>('myAction', (data) => {
// the first argument to the handler function
// is the data argument sent using SendReactMessage
// do whatever logic u want here
setState(data)
})
return(
<div>
<h1>Some component</h1>
<p>{state}</p>
</div>
)
}
Need further support? Join our Discord!