Last active
August 10, 2021 09:31
-
-
Save BjornDCode/a1d7a44d25f7d8d1b0187c18a3816e5d to your computer and use it in GitHub Desktop.
Embed Reform in Gatsby JSX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install and setup gatsby-plugin-react-helmet plugin (https://www.gatsbyjs.com/plugins/gatsby-plugin-react-helmet/) | |
import * as React from 'react' | |
import { Helmet } from 'react-helmet' | |
const IndexPage = () => { | |
return ( | |
<main> | |
<Helmet> | |
<script type="text/javascript"> | |
{` | |
window.Reform=window.Reform||function(){(Reform.q=Reform.q||[]).push(arguments)} | |
`} | |
</script> | |
<script | |
id="reform-script" | |
async | |
src="https://embed.reform.app/v1/embed.js" | |
></script> | |
<script type="text/javascript"> | |
{` | |
Reform('init', { | |
url: 'https://forms.reform.app/XM7SfH/untitled-form-3', | |
target: '#my-reform', | |
}) | |
`} | |
</script> | |
</Helmet> | |
<h1>Page title</h1> | |
<div id="my-reform"></div> | |
</main> | |
) | |
} | |
export default IndexPage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment