Clock SSR fix

old
rodik 2016-02-19 15:43:29 +02:00
parent 794912990a
commit 6173e9b408
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});
});
}
getMouseEventMap () {