How to use the vtex.render-runtime.withRuntimeContext function in vtex

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

github vtex-apps / store / react / components / PageViewPixel.js View on Github external
componentDidMount() {
    this.sendPageViewEvent()
  }

  componentDidUpdate(prevProps) {
    if (prevProps.runtime.route.path !== this.props.runtime.route.path) {
      this.sendPageViewEvent()
    }
  }

  render() {
    return null
  }
}

export default Pixel(withRuntimeContext(PageViewPixel))
github vtex-apps / store / react / OrderPlacedWrapper.js View on Github external
const titleTag = "Order Placed"

    return(
      <DataLayerApolloWrapper
        getData={() => this.getData(orderGroupId)}
      >
        <Helmet>
          <title>{titleTag}</title>
        </Helmet>
        {React.cloneElement(this.props.children, this.props)}
      </DataLayerApolloWrapper>
    )
  }
}

export default withRuntimeContext(OrderPlacedWrapper)