App router does not unmount scripts
Unanswered
New Guinea Freshwater Crocodile posted this in #help-forum
New Guinea Freshwater CrocodileOP
I have a third party script that renders a form from a vendor and I am using the Script component from Next.
When I navigate to the page the form renders fine. The issue is when I navigate back to any other page, the form is still mounted on the page and will appear at the top of every page.
According to the docs, this isn't suppose to happen. Anybody else dealt with this?
I am using the app directory.
When I navigate to the page the form renders fine. The issue is when I navigate back to any other page, the form is still mounted on the page and will appear at the top of every page.
According to the docs, this isn't suppose to happen. Anybody else dealt with this?
I am using the app directory.
2 Replies
@New Guinea Freshwater Crocodile I have a third party script that renders a form from a vendor and I am using the Script component from Next.
When I navigate to the page the form renders fine. The issue is when I navigate back to any other page, the form is still mounted on the page and will appear at the top of every page.
According to the docs, this isn't suppose to happen. Anybody else dealt with this?
I am using the app directory.
Mount script in the page you need it instead of in the router and also what version are you using?
New Guinea Freshwater CrocodileOP
I'm on the latest version. The Script component is mounted on the page, not the layout.