docs: def create_element(cls, type_=None, props=None, *children):
          """
          Signature inspired by React.createElement.
          createElement(
            string/Component type,
            [dict props],
            [children ...]
          )
          https://facebook.github.io/react/docs/top-level-api.html#react.createelement
          """
          # Create an empty document fragment.
          if not type_:
              return cls.dom.create_tag('fragment')
  
          if props is None:
              props = {}
  
          # If the first element of children is a list, we use it as the list.
          if len(children) and isinstance(children[0], (list, tuple)):
              children = children[0]
  
          # The children prop is the first child if there is only one.
          props['children'] = children[0] if len(children) == 1 else children
  
          if callable(type_):
              # Function component, via def or lambda.
              elt = type_(props)
          else:
              # Raw tag, as a string.
              attributes = {}
  
              # Never render those attributes on a raw tag.
              props.pop('children', None)
              props.pop('block', None)
              props.pop('blocks', None)
              props.pop('entity', None)
              props.pop('inline_style_range', None)
  
              # Convert style object to style string, like the DOM would do.
              if 'style' in props and isinstance(props['style'], dict):
                  rules = ['{0}: {1};'.format(DOM.camel_to_dash(s), props['style'][s]) for s in props['style'].keys()]
                  props['style'] = ''.join(sorted(rules))
  
              # Convert props to HTML attributes.
              for key in props:
                  if props[key] is False:
                      props[key] = 'false'
  
                  if props[key] is True:
                      props[key] = 'true'
  
                  if props[key] is not None:
                      attributes[key] = unicode(props[key])
  
              elt = cls.dom.create_tag(type_, attributes)
  
              # Append the children inside the element.
              for child in children:
                  if child not in (None, ''):
                      cls.append_child(elt, child)
  
          # If elt is "empty", create a fragment anyway to add children.
          if elt in (None, ''):
              elt = cls.dom.create_tag('fragment')
  
          return elt