constructor()

in index.js [9:28]


  constructor(props) {
    super(props);
    const { connectOn } = props;
    let { withRules } = props;
    if (connectOn === 'open' && withRules === true) {
      throw new Error(
        "You can't use rules and connect on open, you have to use connect on mount"
      );
    }
    this.webchatRef = null;
    if (withRules === undefined) {
      withRules = true;
    }
    this.state = {
      propsRetrieved: !withRules,
      rulesApplied: !withRules
    };
    this.setRef = this.setRef.bind(this);
    this.handleSessionConfirm = this.handleSessionConfirm.bind(this);
  }