Skip to content

Commit

Permalink
fix(Responsive): fix usage of window for SSR (#2209)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored Oct 17, 2017
1 parent 6360b95 commit 6e85196
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/addons/Responsive/Responsive.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
eventStack,
getElementType,
getUnhandledProps,
isBrowser,
META,
} from '../../lib'

Expand Down Expand Up @@ -55,7 +56,8 @@ export default class Responsive extends Component {

constructor(...args) {
super(...args)
this.state = { width: window.innerWidth }

this.state = { width: isBrowser ? window.innerWidth : 0 }
}

componentDidMount() {
Expand Down

0 comments on commit 6e85196

Please sign in to comment.