You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
I am new to Roact, so correct me if I have any misunderstandings of the library, but I noticed there doesn't seem to be a built in way to create an element from an existing roblox gui object, in the case where you would want to prebuild your GUIs in roblox studio and use them as a template for a Roact based gui library.
I suggest that the library is extended to include this functionality. I have not tested this code, but I am attempting to do it in my code, using a function like this:
local function createRoactElement(guiObject)
local props = {}
for k, v in pairs(guiObject) do
if typeof(v) ~= "function" and k ~= "Parent" and k ~= "ClassName" then
props[k] = v
end
end
return Roact.createElement(guiObject.ClassName, props)
end
The text was updated successfully, but these errors were encountered:
This library uses the latest API dump from roblox to obtain the properties. It is also capable of filtering out properties set to their default, ignoring any assignment of those properties, as it would be redundant.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am new to Roact, so correct me if I have any misunderstandings of the library, but I noticed there doesn't seem to be a built in way to create an element from an existing roblox gui object, in the case where you would want to prebuild your GUIs in roblox studio and use them as a template for a Roact based gui library.
I suggest that the library is extended to include this functionality. I have not tested this code, but I am attempting to do it in my code, using a function like this:
The text was updated successfully, but these errors were encountered: