Code Monkey home page Code Monkey logo

Comments (7)

Bartozzz avatar Bartozzz commented on September 16, 2024 1

+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.

jakubkottnauer avatar jakubkottnauer commented on September 16, 2024

@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.

jedwards1211 avatar jedwards1211 commented on September 16, 2024

@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 :trollface:
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.

usamamashkoor avatar usamamashkoor commented on September 16, 2024

@jakubkottnauer how can i add a component dynamically for loading the script again..?

from react-load-script.

usamamashkoor avatar usamamashkoor commented on September 16, 2024

@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.

jedwards1211 avatar jedwards1211 commented on September 16, 2024

If you change the src prop to another script, my package will load that new script

from react-load-script.

usamamashkoor avatar usamamashkoor commented on September 16, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.