Live edit style with React HMR #3856
Replies: 6 comments 6 replies
-
Sounds like it should be possible. |
Beta Was this translation helpful? Give feedback.
-
I found it simpler to real-time manipulate the style once its in js object. Might be doing something wrong here though, just started with the maps. So i can't really use Maputnik anymore Changing style does trigger some kind of re-render, since map view state gets reset, however style isn't updated until i actually reload the page. Style passed to the map via useState hook. Any clues what could be wrong here? |
Beta Was this translation helpful? Give feedback.
-
I can't help without seeing any code, I'm also not a react expert, so I might also be wrong... |
Beta Was this translation helpful? Give feedback.
-
The code is basic Style.tsx
Map component
|
Beta Was this translation helpful? Give feedback.
-
To me it seems unlikely that HMR can help with this. If your reloaded module contained not just an object but for example a call to |
Beta Was this translation helpful? Give feedback.
-
react-map-gl states map style would be reloaded on prop change. However, there is something wrong going on with the state I think the question is out of scope of this repo, closing this discussion |
Beta Was this translation helpful? Give feedback.
-
Hi,
I've got map style implemented in js object as StyleSpecification
Is it possible to utilise React HMR to reload style on changes somehow?
Beta Was this translation helpful? Give feedback.
All reactions