react.js / How do I resolve console errors(Object.W already exists) when moving pages in a single page application?
-
Hello, I am using windy map in react.js (+typescript).
There is no problem with the first load. However, if you go to another page and return to the page with the windyMap, you will see an error like the picture.
so I referring this link
( https://community.windy.com/topic/6503/redrawing-or-reinitialising-windyapi-in-a-single-page-app/3 )
and added the code before Function windyInit()//@ts-ignore if (!window.copy_of_W) { window.copy_of_W = { ...window.W } } if (window.W.windyBoot) { window.W = { ...window.copy_of_W } } windyInit(options, (windyAPI)) =>{ const { map, picker, store } = windyAPI ... }
But error not resolved.
Is there any other solution?
No matter how much I looked on the Internet, I could only find a way to link.Please help me...
Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
NodeBB & contributors, OSM & contributors, HERE maps