Skip to content

Commit

Permalink
fix: dont make unnecessary calls to updateStatus in RN (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandernanberg authored and Kent C. Dodds committed Jul 21, 2018
1 parent 672bd6e commit 2584de1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/downshift.js
Original file line number Diff line number Diff line change
Expand Up @@ -913,10 +913,8 @@ class Downshift extends Component {
...state,
})
this.previousResultCount = resultCount
/* istanbul ignore else (react-native) */
if (preval`module.exports = process.env.BUILD_REACT_NATIVE !== 'true'`) {
setA11yStatus(status)
}

setA11yStatus(status)
}, 200)

componentDidMount() {
Expand Down Expand Up @@ -1010,7 +1008,10 @@ class Downshift extends Component {
this.scrollHighlightedItemIntoView()
}

this.updateStatus()
/* istanbul ignore else (react-native) */
if (preval`module.exports = process.env.BUILD_REACT_NATIVE !== 'true'`) {
this.updateStatus()
}
}

componentWillUnmount() {
Expand Down

0 comments on commit 2584de1

Please sign in to comment.