Is it possible to store a mutable object in the store redux?
I'm trying to create a wrapper over the external library of the mapbox in my app. I create a map object using the library:
Component - Map
import * as MapboxGl from 'mapbox-gl'
.......
componentDidMount() {
this.mapObject = new MapboxGl.Map({
container: this.MapContainer
style: 'mapbox://styles/mapbox/light-v9',
})
}
.......
Next, I need to pass the mapObject to the child components. Structure of components:
<App>
........
<Map>
<Source>
<Layer />
<Layer />
</Source>
</Map>
.......
</App>
- How can I transfer an mapObject to the child components (Source / Laer) (can I save this object to the redux store or use the react context and save the data for the mapObject in the store redux)?
- Can you share a link to a full-fledged project (giths) for working with maps where the above situation is implemented?