Skip to content

Commit 0d67098

Browse files
authored
fix 100 to make it work
1 parent 22428d7 commit 0d67098

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,6 +2021,11 @@
20212021
20222022
```javascript
20232023
class WindowDimensions extends React.Component {
2024+
constructor(props){
2025+
super(props);
2026+
this.updateDimensions = this.updateDimensions.bind(this);
2027+
}
2028+
20242029
componentWillMount() {
20252030
this.updateDimensions()
20262031
}
@@ -2034,7 +2039,7 @@
20342039
}
20352040

20362041
updateDimensions() {
2037-
this.setState({width: $(window).width(), height: $(window).height()})
2042+
this.setState({width: window.innerWidth, height: window.innerHeight})
20382043
}
20392044

20402045
render() {

0 commit comments

Comments
 (0)