Skip to content

Commit

Permalink
fix(defaultProps): use undefined environment on React Native (#1546)
Browse files Browse the repository at this point in the history
  • Loading branch information
silviuaavram committed Sep 25, 2023
1 parent 0dd0ab4 commit 7d8c32d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/downshift.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Downshift extends Component {
selectedItemChanged: (prevItem, item) => prevItem !== item,
environment:
/* istanbul ignore next (ssr) */
typeof window === 'undefined' ? undefined : window,
typeof window === 'undefined' || isReactNative ? undefined : window,
stateReducer: (state, stateToSet) => stateToSet,
suppressRefError: false,
scrollIntoView,
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const defaultProps = {
scrollIntoView,
environment:
/* istanbul ignore next (ssr) */
typeof window === 'undefined' ? undefined : window,
typeof window === 'undefined' || isReactNative ? undefined : window,
}

function getDefaultValue(
Expand Down

0 comments on commit 7d8c32d

Please sign in to comment.