--- Updates the current instance state.

function ScopeHierarchyItemButton:UpdateInstanceState()
    local NewName = self.props.Instance.Name
    local MaxTextBounds = Vector2.new(math.huge, math.huge)
    local TextBounds = TextService:GetTextSize(NewName, 33/2, Enum.Font.SourceSans, MaxTextBounds)

    -- Update instance state
    self:setState({
        InstanceName = NewName;
        InstanceNameLength = TextBounds.X;
    })
end
