Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
Simplified shouldComponentUpdate function in Controller example
Browse files Browse the repository at this point in the history
Summary:
## Motivation (required)

I've been digging through the react-vr source code and I've noticed a conditional in one of the examples that can be simplified, this PR ensures that

## Test Plan (required)
`npm test` runs without any errors
Closes #107

Differential Revision: D4930440

Pulled By: andrewimm

fbshipit-source-id: 1115e49
  • Loading branch information
Tomasz Lakomy authored and facebook-github-bot committed Apr 21, 2017
1 parent a284d2b commit 0c9c4a8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Examples/Controller/index.vr.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ class PressState extends React.Component {
if (nextProps.pressed !== this.props.pressed) {
return true;
}
if (nextState.hasFocus !== this.state.hasFocus) {
return true;
}
return false;
return nextState.hasFocus !== this.state.hasFocus;
}

render() {
Expand Down

0 comments on commit 0c9c4a8

Please sign in to comment.