stats.js icon indicating copy to clipboard operation
stats.js copied to clipboard

add options for container and cssText

Open yofreke opened this issue 9 years ago • 0 comments

I am using stats.js in a react project. This means I do not want stats creating dom nodes. This PR lets a user configure the stats style string, as well as the container element.

React example usage:

CoolComponent extends React.Component {
  componentDidMount () {
    this._stats = new Stats({ container: this.refs.statsContainer, cssText: '' });
  }

  render () {
    return (
      <div class='cool-component'>
        <div ref='statsContainer' />
      </div>
    );
  }
}

yofreke avatar Sep 15 '16 20:09 yofreke