You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? I want to create a roact element in a function but I dont know how to name it.
-
What is the issue? It wont let me name it like its children or through its properties
-
What solutions have you tried so far? Ive looked everywhere but it seems nobody has encountered this issue
As you can see for the frame element I cannot change its name no matter what and its name is just the name that roact gave it, while the frames children can be named by naming it a variable it is hard to do that as there requires a return for this function.
return Roact.createElement("Frame",{
Name = "Hello",
Position = props.Position,
BackgroundTransparency = 1,
Size = UDim2.fromScale(0.05, 0.125),
}, {
Button = Roact.createElement("ImageButton", {
Image = "rbxassetid://17322749703",
BackgroundTransparency = 1,
ScaleType = "Fit",
Size = UDim2.fromScale(0.7, 1),
[Roact.Event.Activated] = function(rbx)
print("Clicked ".. rbx.Name)
print(props.Name)
end,
}, {})
})
Cheers!