Next.js Discord

Discord Forum

App router does not unmount scripts

Unanswered
New Guinea Freshwater Crocodile posted this in #help-forum
Open in Discord
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.

2 Replies