I dont "get" the point behind Roact

Full Disclosure: I am not a fan of Roact, I’m sure a few people are aware of my opinion on it. I have tried it for a few hours and never understood it.


The main problem I have against is Roact is how it handles property/state changes.

In normal GUIs, you’d probably just change the property of the frame and let Roblox itself handle it.

local TextLabel = Instance.new("TextLabel")

function updateTextLabel(p)
  for name, property in pairs(p) do
    TextLabel[name] = property
  end
end

However, Roact opts to force you to recreate the entire element, instead of just changing its current render.
(i cant remember the function name so i’ll just use update)

function button:update()
  return Roact.createElement()
end

So I’ll ask it again, what is the point of Roact?

1 Like

I’ve never used Roact but assuming it’s built to replicate React, you will only see benefits if you are working on a big system with many layers. For smaller projects this kind of overhead is usually not worth it.

1 Like