0

I want to add AddThis social buttons to my articles.

In NextJS, the AddThis script only loads once when the site has been loaded. If I go to other articles/pages then this AddThis social buttons wont appear.

Does anybody know how to solve this? Thanks in advance!

I've tried NextJS <Script> component, useEffect, useRouter, but it won't work.

1 Answers1

0

Yes, because <Script> tag will run only once per page load. While you are clicking, for example, <Link> tag, the page is not really reloaded.

Check what you can do here, if you have dynamic scripts you need "force add" them to you page with useEffect.

illia chill
  • 1,652
  • 7
  • 11