How to use the omi.createElement function in omi

To help you get started, we’ve selected a few omi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Tencent / omi / packages / omiu / src / rc-tree / tree-node.js View on Github external
// Icon - Still show loading icon when loading without showIcon
    let $icon;

    if (showIcon) {
      const currentIcon = icon || treeIcon;

      $icon = currentIcon ? (
        <span>
          {typeof currentIcon === 'function' ?
            omi.createElement(currentIcon, {
              ...this.props,
            }) : currentIcon}
        </span>
      ) : this.renderIcon();
    } else if (loadData &amp;&amp; loading) {
      $icon = this.renderIcon();
    }

    // Title
    const $title = <span>{title}</span>;

    return (
github Tencent / omi / packages / omiu / src / rc-tree / tree-node.js View on Github external
switcherIcon: switcherIconFromProps,
    } = this.props;
    const {
      omiTree: {
        prefixCls,
        switcherIcon: switcherIconFromCtx,
      }
    } = this.store;

    const switcherIcon = switcherIconFromProps || switcherIconFromCtx;

    if (this.isLeaf()) {
      return (
        <span>
          {typeof switcherIcon === 'function' ?
            omi.createElement(switcherIcon, { ...this.props, isLeaf: true }) : switcherIcon}
        </span>
      );
    }

    const switcherCls = classNames(`${prefixCls}-switcher`, `${prefixCls}-switcher_${expanded ? ICON_OPEN : ICON_CLOSE}`);
    return (
      <span>
        {typeof switcherIcon === 'function' ?
          omi.createElement(switcherIcon, { ...this.props, isLeaf: false }) : switcherIcon}
      </span>
    );
	}

omi

<p align="center"><img src="https://omijs.github.io/home/assets/logo.svg" alt="omi" width="100"/></p> <h2 align="center">Omi - Web Components Framework</h2>

MIT
Latest version published 26 days ago

Package Health Score

78 / 100
Full package analysis