Skip to content
Permalink
Browse files

feat: only update if variant changes

  • Loading branch information...
danhayden committed Jul 20, 2017
1 parent ace0249 commit 1fda059ec7703fe3794a52117f6be3a50dcc27ca
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/react-simple-experiment.js
@@ -41,6 +41,10 @@ export class Experiment extends React.Component {
})
}

shouldComponentUpdate (nextProps, nextState) {
return nextState.variant !== this.state.variant
}

render () {
if (!this.state.variant) {
return null

0 comments on commit 1fda059

Please sign in to comment.
You can’t perform that action at this time.