Skip to content

Commit

Permalink
Merge pull request #1599 from danieldunderfelt/better-browser-check
Browse files Browse the repository at this point in the history
Skip 'this' for a better window check that actually works and passes tests
  • Loading branch information
kitten authored Mar 13, 2018
2 parents 35d0f56 + 11f2f69 commit fa872e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ All notable changes to this project will be documented in this file. If a contri

- Fix nested media at-rules by upgrading to stylis@^3.5.0 and stylis-rule-sheet@^0.0.10 (see [#1595](https://github.com/styled-components/styled-components/pull/1595))

- Fix the `IS_BROWSER` check to work more reliably in projects where `window` may be shimmed, by [@danieldunderfelt](https://github.com/danieldunderfelt) (see [#1599](https://github.com/styled-components/styled-components/pull/1599))

## [v3.2.1] - 2018-03-07

- Fix `@import` rules not being enforced to appear at the beginning of stylesheets (see [#1577](https://github.com/styled-components/styled-components/pull/1577))
Expand Down
3 changes: 2 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const SC_ATTR = 'data-styled-components'
export const SC_STREAM_ATTR = 'data-styled-streamed'
export const CONTEXT_KEY = '__styled-components-stylesheet__'

export const IS_BROWSER = typeof window !== 'undefined'
export const IS_BROWSER =
typeof window !== 'undefined' && 'HTMLElement' in window

export const DISABLE_SPEEDY =
(typeof __DEV__ === 'boolean' && __DEV__) ||
Expand Down
Loading

0 comments on commit fa872e5

Please sign in to comment.