How to use the onsenui._autoStyle function in onsenui

To help you get started, we’ve selected a few onsenui 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 OnsenUI / OnsenUI / bindings / react / src / components / BasicComponent.jsx View on Github external
if (typeof this.props.className !== 'undefined') {
      if (this.lastClass) {
        node.className = node.className.replace(this.lastClass, ' ');
      }

      this.lastClass = this.props.className.trim();

      node.className = node.className.trim() + ' ' + this.lastClass;
    }

    if (!ons) {
      throw new Error("react-onsenui requires `onsenui`, make sure you are loading it with `import onsenui` or `require('onsenui')` before using the components");
    }

    ons._autoStyle.prepare(node);
  }
github OnsenUI / react-onsenui / src / components / BasicComponent.jsx View on Github external
if (typeof this.props.className !== 'undefined') {
      if (this.lastClass) {
        node.className = node.className.replace(this.lastClass, ' ');
      }

      this.lastClass = ' ' + this.props.className.trim();

      node.className = node.className.trim() + this.lastClass;
    }

    if (!ons) {
      throw new Error("react-onsenui requires `onsenui`, make sure you are loading it with `import onsenui` or `require('onsenui')` before using the components");
    }

    ons._autoStyle.prepare(node);
  }