Merge pull request #332 from sars/clock-ssr-fix

Clock SSR fix
old
Javi Velasco 2016-02-19 16:17:03 +01:00
commit ad7abe557d
2 changed files with 6 additions and 2 deletions

View File

@ -30,7 +30,9 @@ class Clock extends React.Component {
componentDidMount () {
window.addEventListener('resize', this.handleCalculateShape);
this.handleCalculateShape();
setTimeout(() => {
this.handleCalculateShape();
});
}
componentWillUnmount () {

View File

@ -27,7 +27,9 @@ class Hand extends React.Component {
};
componentDidMount () {
this.setState({knobWidth: this.refs.knob.offsetWidth});
setTimeout(() => {
this.setState({knobWidth: this.refs.knob.offsetWidth});
});
}
componentWillUnmount () {