render()

in index.js [65:96]


  render() {
    const { onSocketEvent } = this.props;
    let { withRules } = this.props;
    if (withRules === undefined) {
      withRules = true;
    }
    const { propsRetrieved } = this.state;
    let propsToApply = {};
    if (propsRetrieved) propsToApply = propsRetrieved;
    delete propsToApply.rules;
    return (
      <div
        className={this.props.embedded || (propsToApply && propsToApply.embedded) ? 'rw-pro-widget-embedded' : ''}
      >
        <RasaWebchatPro
          ref={this.setRef}
          {...{
            ...propsToApply,
            ...this.props
          }}
          onSocketEvent={
            withRules
              ? {
                session_confirm: this.handleSessionConfirm,
                ...onSocketEvent
              }
              : { ...onSocketEvent }
          }
        />
      </div>
    );
  }