A simple template to make FiveM Lua scripts with NUI created in ReactJS. Webpack is configured to make editing easier. Editing styles and assets doesn’t require building a Node project. Only changes in JS/JSX files require building.
Hello! I just needed something simple for me, so I made it and published it if someone else needed it too. Why my resource? Not everyone wants to use TypeScript. Also, the problem with most other resources like that is that they have a lot of useful files, code, and packages. I made something simple that is easy to use for developers and for people.
Interesting, I personally just use Vite to create react-project and then I just have eventlistener for ‘message’ in the main.jsx and use SendNuiMessage on the client to control the rendering of the ui.
How does this simple template differ from the way how I work with NUI on fivem?
So, the main difference (probably, because I don’t know how do you have configured react) is that everyone can edit assets and styles without building project. I think that it is very helpful. In that resource I added also small utils… With it you dont need to add all headers, links etc to nui fetch. You can simply use one function to make it. You can also use useNui function, and you won’t need to add new event listeners for every message.