Rishabh Kumar
Rishabh Kumar

Reputation: 7

How can i add widget in netlify create local code development?

I have created a website using Netlify create Template of Next JS, I am not able to find index.html file where i want to put the script tags for my widgets. Can anyone help me for this.

I tried to add the scripts using useEffect, which is not suitable, like this:

useEffect(() => {
  const script = document.createElement('script');
  script.src = 'https://widget.clutch.co/static/js/widget.js';
  script.async = true;
  document.body.appendChild(script);

  return () => {
      document.body.removeChild(script);
  };
}, []);

I want to attach this widget into the index.html file but I am not able to find it.

Upvotes: 0

Views: 16

Answers (0)

Related Questions