0

I am building a page in react. I am zooming on the page from 100% to several levels.

How can I set the zooming to 100% when the page is reloading by refreshing?

Should I go through window.innerWidth on componentWillMount?

I am trying few things but I could not manage to get it work.

    componentWillMount () {
  if (window.innerWidth !== window.outerWidth){
window.resizeTo(window.outerWidth, window.outerHeight)
  }
}
Ectoras
  • 1,297
  • 3
  • 13
  • 33
  • you don't have eventListener, so onMount, add window.addEventListener("resize", handleMyWindowSize) – max li Feb 09 '18 at 11:18
  • Hmm, I tried this and it does not work on the component will mount.. window.addEventListener("resize", window.resizeTo(window.outerWidth, window.outerHeight)) . I am using Chrome – Ectoras Feb 09 '18 at 11:28
  • possible duplicate of https://stackoverflow.com/questions/21093570/force-page-zoom-at-100-with-js – Josh Pittman Feb 09 '18 at 11:44
  • Thanks Josh. This works for scaling.. However my problem is that when I am refreshing my page still has the previous zoomming. For instance, if I zoom on 80% on refresh it remains on 80% and not on 100% I want. Do I need to reset anything more? – Ectoras Feb 09 '18 at 11:52

0 Answers0