external script not woking Everytime, When Navigate Page And go Back again that page script not working. but when reload again that time work. #59882
Unanswered
clevermiraz
asked this question in
App Router
Replies: 1 comment
-
Same issue is here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am facing a problem with scripts.
I have included normal <Script /> in NextJS
NextJs
scripts
are working when the page is accessed for the first time or reloaded. It's not working when I navigate to any other page.I have even tried with simple alert, but it is still not working. It's only working when the page is opened for the first time or on reload.
I have even try to include scripts in useEffect Hook but still same issue.
Try This Solution: https://www.altcademy.com/blog/how-to-load-js-src-from-script-tag-in-reactjs/#:~:text=as%20a%20module.-,Loading%20External%20JavaScript%20Files%20in%20ReactJS,file%20in%20your%20React%20project.&text=This%20approach%20has%20the%20advantage,it%20also%20has%20some%20downsides.
still same issue
Is there any other way to access or recall scripts when I navigate the page? Please help
Beta Was this translation helpful? Give feedback.
All reactions