Skip to content

Commit

Permalink
[Overlay] Fix server side rendering
Browse files Browse the repository at this point in the history
The componentDidMount method is not called when rendering server side
  • Loading branch information
oliviertassinari committed Oct 31, 2015
1 parent 6141e2b commit 80141f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/overlay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const Overlay = React.createClass({
};
},

componentWillMount() {
componentDidMount() {
this._originalBodyOverflow = document.getElementsByTagName('body')[0].style.overflow;
},

Expand Down

1 comment on commit 80141f6

@oliviertassinari
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
From the doc

Invoked once, only on the client (not on the server), immediately after the initial rendering

Please sign in to comment.