1.3.1 • Published 4 years ago

@brandensilva/react-use-hubspot-form v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

React Use HubSpot Form Embed

npm (scoped) Bundle Size License

Embed HubSpot forms into your React components using hooks! Works with Create React App, Gatsby and other platforms.

Install

$ npm install --save @brandensilva/react-use-hubspot-form
$ yarn add @brandensilva/react-use-hubspot-form

Usage

import React from 'react';

import { useHubspotForm } from '@brandensilva/react-use-hubspot-form';

const MyPage = () => {
    const { loaded, error, formCreated } = useHubspotForm({
        portalId: 'XXXXXXX',
        formId: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
        target: '#my-hubspot-form'
    });

    return (
        <div>
            <h1>Embed Form Below</h1>
            <div id="my-hubspot-form"></div>
        </div>
    )
}