Created
September 21, 2021 14:47
-
-
Save jrbaudin/f64e0a57ddb663ad34278c6fd8c15479 to your computer and use it in GitHub Desktop.
Reform.app embedded form in Next.js
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
import Script from 'next/script' | |
type Props = { | |
formUrl: string | |
} | |
export const ReformEmbed = ({ formUrl }: Props) => { | |
return ( | |
<> | |
<div id="my-reform" className="z-50 relative" /> | |
<Script> | |
{`window.Reform=window.Reform||function(){(Reform.q=Reform.q||[]).push(arguments)};`} | |
</Script> | |
<Script | |
id="reform-script" | |
src="https://embed.reform.app/v1/embed.js" | |
onLoad={() => { | |
window.Reform('init', { | |
url: formUrl, | |
target: '#my-reform', | |
}) | |
}} | |
/> | |
</> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment