Comments (7)
+1
This would be a very usefull feature. Personally, I need this to implement PayU Express Widget. Maybe #5 could resolve this?
from react-load-script.
@bibogdanov Hi, most of what this component does happens in componentDidMount
, which is only called once - when the component is mounted. That is why, when you pass a different set of props, nothing happens. Currently, the only solution would be to render another react-load-script component, instead of just changing the url
prop.
If supporting this is something more people would like or if it proved to be necessary, I can add this functionality.
from react-load-script.
@bibogdanov @Bartozzz I just made my own package for this...cause it looks like PRs to this package aren't gonna get merged anytime soon
https://github.com/jcoreio/react-render-props-script-loader
It supports the src
prop changing, and additionally, it passes the state to a child function, so you don't have to bother with storing state in your own code :)
One downside: my package makes less effort to be compatible with old React versions, and it depends on babel-runtime
if you're using it in legacy browsers.
from react-load-script.
@jakubkottnauer how can i add a component dynamically for loading the script again..?
from react-load-script.
@jedwards1211 how can i re render the google maps script again using your package because the documentation is very less in terms of this part...?
from react-load-script.
If you change the src
prop to another script, my package will load that new script
from react-load-script.
@jedwards1211 i am facing this issue I have created progressive web app and I am using google maps so in offline mode when there is no internet then the google maps do not load but when the internet becomes available then I want to reload that same google maps API script so that I can access the goog;e variable inside in my react component again...
Can you please help me how can I do this using your package because in my case the script is already in the dom but the google variable is not available due to the no internet and also I have the same src prop because I want to re-load the same google maps URL so how can I reload the same google script again using your package kindly help me on this please...?
from react-load-script.
Related Issues (20)
- Allow async=false via prop attributes HOT 4
- Script not load again after react-router changes HOT 6
- [Feature Request]: Support for async and defer attributes HOT 2
- Save my day...
- react16 support
- Script not be removed when the Parent Component unmounted. HOT 1
- How to use? HOT 6
- TypeScript types definition HOT 4
- How to load script if contains <!--[if lte IE 8]><![endif]-->
- Local scripts? HOT 1
- Loading multiple, dependent scripts HOT 4
- Can't change the component once it's mounted to the DOM HOT 1
- How to reload the script.
- Script loads after 3 characters how this implement?
- How to use 3rd script's function HOT 1
- onLoad not work in next react
- How to *not* load a script if it's already loaded...
- How to detect if the script is already loaded? HOT 6
- Feature Request script tag with js code. HOT 1
- Passing custom arguments to the script HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-load-script.