I created two Roact components, one is the base, and the another component is a custom one, which inherits the base.
-- base
function UIComponents.ButtonBase(props)
return Roact.createElement("ImageLabel", {
Size = props.elementSize,
ImageColor3 = props.imageColor3,
Image = "rbxassetid://3570695787",
BackgroundTransparency = 1,
ScaleType = props.scaleType,
SliceCenter = props.sliceCenter,
SliceScale = props.sliceScale,
})
end
--custom component
function UIComponents.StyleButton(props)
return Roact.createElement(UIComponents.ButtonBase, props, {
HotkeyLabel = Roact.createElement("TextLabel", {
Text = "test",
TextScaled = true,
}),
})
end
The problem is that, when I try to render the UIComponents.StyleButton
, its children doesn’t get created.
No output error, I tried searching the docs and forum but couldn’t find a solution. I think it has something to do with the inheritance thing. Can somebody help me with this?