How can I change the language map in run
Hello,
I need to change googleMaps language on the run, to do this I need to re-fetch google maps script with the right locale.
But when the HOC withScriptjs receive a new value for googleMapURL prop, the new URL is not fetched. Actually, withScriptjs file does not implement this behavior.
Did I miss something? Maybe @tomchentw you know why?
Can I contribute to solving this?
Thanks
You could probably implement this behavior pretty easily. I would imagine something like:
- Add the componentDidUpdate method
- Check if googleMapUrl has changed
If so, set loadingState to LOADING_STATE_BEGIN and then run the following lines from componentDidMount:
const scriptjs = require(`scriptjs`)
const { googleMapURL } = this.props
scriptjs(googleMapURL, this.handleLoaded)
(Should probably be extracted to a function)
Is there any update? I need this feature for my app.