dozoisch / dozoisch/react-async-script
How do you pass params to the URL?
- Langage dominant
- JavaScript
- Étoiles
- 177
- Forks
- 29
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Hi,
In the example shown, the URL is known upfront and hardcoded. Is it possible to pass in props into the wrapper that helps determine what the URL is and then inject that URL being used?
In my use case, bing maps api, I need to add in query params to set the Language or local.
example of what i'm looking for.
Then in the WrapperComponent it takes the url props and builds the URL that is injected into the default.
export default AsyncScriptLoader(BingMapWidget, URL, {
callbackName: callbackName,
globalName: globalName,
});
However, its not clear to me if it's possible to expose the wrapper to take in those params so then i can run a method to compute the URL and spit it back to the AsyncScriptLoader
Also i notice that you are attaching to the global scope. What happens if you launch two instances of the wrapped components. Would there be issues since they will share the same callback?
Thanks,
Derek
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par lire l’API de AsyncScriptLoader et l’utilisation de WrapperComponent présentée dans l’issue, en vous concentrant sur la manière dont URL, callbackName et globalName sont fournis. Suivez le cheminement possible de Props jusqu’à la construction de l’URL et la manière dont plusieurs instances enveloppées partagent les callbacks. La tâche est terminée lorsque les problèmes de l’issue concernant les paramètres d’URL dynamiques et les instances multiples disposent d’une résolution documentée et testée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, react
- Domaine
- frontend
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100