def safe_react_attribute_name(name):
    """ Convert given raw attribute name into a valid React HTML tag attribute name.

        :param name: attribute to convert
        :return: valid attribute
        :type name: str
        :rtype: str
    """
    if name == 'class':
        return 'className'
    if '-' in name:
        input_pieces = name.split('-')
        output_pieces = [input_pieces[0]]
        for piece in input_pieces[1:]:
            output_pieces.append('%s%s' % (piece[0].upper(), piece[1:]))
        return ''.join(output_pieces)
    if name == 'xlink:href':
        return 'href'
    return name
