local height, setHeight = hooks.useState(0)
froact.TextLabel({
Size = UDim2.new(1, 0, 0, height),
Text = "Text",
onChanged = function(rbx, property)
if property == "TextBounds" then
setHeight(rbx.TextBounds.Y)
end
end,
})
There should be a "bind" field that does the same:
local height, setHeight = hooks.useState(0)
froact.TextLabel({
Size = UDim2.new(1, 0, 0, height),
Text = "Text",
bindTextBounds = setHeight,
})
In the background, this will create a callback for the Changed event.
Bind fields will only be generated for properties prefixed with Absolute, or TextBounds
Rather than having to do:
There should be a "bind" field that does the same:
In the background, this will create a callback for the
Changed
event. Bind fields will only be generated for properties prefixed withAbsolute
, orTextBounds