We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22428d7 commit 0d67098Copy full SHA for 0d67098
README.md
@@ -2021,6 +2021,11 @@
2021
2022
```javascript
2023
class WindowDimensions extends React.Component {
2024
+ constructor(props){
2025
+ super(props);
2026
+ this.updateDimensions = this.updateDimensions.bind(this);
2027
+ }
2028
+
2029
componentWillMount() {
2030
this.updateDimensions()
2031
}
@@ -2034,7 +2039,7 @@
2034
2039
2035
2040
2036
2041
updateDimensions() {
2037
- this.setState({width: $(window).width(), height: $(window).height()})
2042
+ this.setState({width: window.innerWidth, height: window.innerHeight})
2038
2043
2044
2045
render() {
0 commit comments