domElement

ReactElement domElement(

  1. String tagName, [
  2. Map<String, Object?>? props,
  3. List<ReactElement>? children
])

Creates a React element for the given HTML tag name.

This is a low-level function. Prefer using the specific element functions like div, span, p, etc.

Implementation

ReactElement domElement(
  String tagName, [
  Map<String, Object?>? props,
  List<ReactElement>? children,
]) => (children != null && children.isNotEmpty)
    ? createElementWithChildren(
        tagName.toJS,
        props != null ? createProps(props) : null,
        children,
      )
    : createElement(tagName.toJS, props != null ? createProps(props) : null);