useTheme
A hook used internally by components for reading the selected Studio Theme and thereby visually theming components appropriately. It is exposed here so that custom components can use this API to achieve the same effect. Calling the hook returns a StudioTheme instance. For example:
local function MyThemedComponent()
local theme = useTheme()
local color = theme:GetColor(
Enum.StudioStyleGuideColor.ScriptBackground,
Enum.StudioStyleGuideModifier.Default
)
return React.createElement("Frame", {
BackgroundColor3 = color,
...
})
end