What is the difference between Roact and React-lua?

Hi there,

I’m writing this post to understand the difference between “Roact” and “React-lua”. I’ve come across both of them quite often on the Developer Forum and more recently in an announcement about Roblox Hack Week 2023. As far as I know, Roact is used for creating user interfaces after going through ModuleScripts in Roblox Studio. However, I’m unsure about React-lua. The name is similar to React, but it seems to be more Lua-based.

If anyone could help me out with this issue, it would be greatly appreciated.

Thank you!

1 Like

Bumping to know if anyone can help me out with this question! :slightly_smiling_face:

Roact and React-lua are just Luau implementations of the aforementioned React framework. React-lua is just a newer version of Roact and follows the React documentation closely

Roact is an approximate port of ReactJS v16 into Lua. Internally, it deviates heavily from ReactJS and has several critical performance and general stability failure cases. Fixing these would require a major overhaul of Roact’s internals. Roact is also missing several major features that React Lua introduces.

React-lua is a 1:1, file-for-file, test-for-test translation of ReactJS v17 with as few deviations as realistically possible (documented here.) It outperforms Roact in every benchmark and introduces several new features (such as hooks, error boundaries, and Suspense).

Legacy Roact is now archived by Roblox, and you should be using React-lua for all new work. You’ll also likely see benefit migrating an existing project to React-lua (there are docs on how to do this).

3 Likes

Interesting! And how and when can I use React-lua for projects of mine? Do I need to have specifics requirements beforehand?

There are no specific requirements to use it. The project is open-source.

I meant that I would need to acknowledge other programming languages before using the open-source project…

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.