Skip to content

Instantly share code, notes, and snippets.

@jrbaudin
Created September 21, 2021 14:47
Show Gist options
  • Save jrbaudin/f64e0a57ddb663ad34278c6fd8c15479 to your computer and use it in GitHub Desktop.
Save jrbaudin/f64e0a57ddb663ad34278c6fd8c15479 to your computer and use it in GitHub Desktop.
Reform.app embedded form in Next.js
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