Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Thinking metrics on React apps

Thinking metrics on React apps

Jean Carlo Emer

October 27, 2016
Tweet

More Decks by Jean Carlo Emer

Other Decks in Technology

Transcript

  1. @PureRender class PageView extends Component { static propTypes = {

    location: PropTypes.object.isRequired } componentDidMount() { const { action, state } = this.props.location trackPageView(action, state) } componentDidUpdate() { /* */ } }
  2. <Playlist /> <Recommendation /> <Video 
 metrics="playlist" /> is a

    list of <Video 
 metrics="recommendation" /> is a list of
  3. class Video extends Component { static contextTypes = { linkMetrics:

    PropTypes.object } render() { const state = { metrics: this.context.linkMetrics } return <Link state={state}>/* ... */</Link> } }