You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
i use react-load-script to load a script in a component.
If this component is instantiated a second time, i wanna detect if the script was loaded before.
Does react-load-script support this functionality?
Activity
andresin87 commentedon Jun 20, 2017
#5
...solves that problem.
daveyx commentedon Jun 21, 2017
means i don't have to care about it, as of
onLoad() will also be called in my second instantiation after the script was successfully loaded, right?
andresin87 commentedon Jun 26, 2017
If the props are changed (typeOf [prop] !== 'function'), It will call
onLoad()again @daveyx. That's right.daveyx commentedon Jun 27, 2017
thx @andresin87 any plan for next release in npm?
jakubkottnauer commentedon Jul 7, 2017
Hi @daveyx and @andresin87, we'll make a release as soon as that PR is merged.
matejlauko commentedon Aug 3, 2017
@daveyx
The current version already calls onLoad() every time the component has been mounted.
So to detect if the script was loaded before, the best would be to track inside your app state if onLoad has been called.
Or you can do: