I’m having a problem with testing my meteor app on the chrome device emulator. The emulator is reporting the wrong window.innerWidth/Height. On Safari everything is fine.
I reported the problem to the Chromium issue tracker see here but they can’t reproduce the problem.
They suggest it might be Meteor/React connected…?
Anyone here experienced similar problems ?
Or are you willing to give this little sample a try:
size.jsx:
import React from 'react'
import ReactDOM from 'react-dom'
Meteor.startup(function () {
const App = React.createClass({
resize () {
this.setState({
width: window.innerWidth,
height: window.innerHeight
});
},
componentWillMount () {
this.resize();
},
componentDidMount () {
window.addEventListener("resize", this.resize);
},
componentWillUnmount () {
window.removeEventListener("resize", this.resize);
},
render () {
return <div>width: {this.state.width}, height: {this.state.height}</div>
}
});
ReactDOM.render(<App />, document.getElementById('App'));
});
size.html:
<head>
</head>
<body>
<div id="App"></div>
</body>