title: How to navigate to home page after submitting the google form
body: <p>I need to integrate the google form inside my gatsby application. In onsubmit I have opened the google form. Once after filling the form details after submitting the form I need to take user to home page. I have tried using useNavigate and history I couldn't able to navigate the page to home. Can anyone guide me how to achieve this. Thanks in advance.</p>
  <pre><code>function GoogleLink() {
    let navigate = useNavigate()
  
    let openFrame = () =&gt; {
      let iframe = document.createElement(&quot;iframe&quot;)
      iframe.src = `googleform link`
      iframe.frameBorder = &quot;0&quot;
      iframe.id = &quot;iframe&quot;
      iframe.style.position = &quot;absolute&quot;
      iframe.style.zIndex = &quot;999&quot;
      iframe.style.height = &quot;100%&quot;
      iframe.style.width = &quot;100%&quot;
      iframe.style.top = &quot;0&quot;
      iframe.style.backgroundColor = &quot;white&quot;
      iframe.style.border = &quot;none&quot;
      document.body.prepend(iframe)
      document.body.style.overflow = &quot;hidden&quot;
    }
  
    const handleSubmit = () =&gt; {
      openFrame()
      navigate(&quot;/home&quot;)
    }
    return (
      &lt;Layout&gt;
        &lt;div&gt;
          &lt;Row&gt;
            &lt;Col&gt;
              &lt;Button onClick={handleSubmit}&gt;Click Here&lt;/Button&gt;
            &lt;/Col&gt;
          &lt;/Row&gt;
        &lt;/div&gt;
      &lt;/Layout&gt;
    )
  }
  </code></pre>