Embed HubSpot forms into your React components using hooks! Works with Create React App, Gatsby and other platforms.
npm install @aaronhayes/react-use-hubspot-form

!License
Embed HubSpot forms into your React components using hooks! Works with Create React App, Gatsby and other platforms.
```
$ npm install --save @aaronhayes/react-use-hubspot-form
``
$ yarn add @aaronhayes/react-use-hubspot-form
Wrap your application with HubspotProvider. This will add Hubspot script to the head of your document.
`TypeScript
import React from 'react';
import { HubspotProvider } from '@aaronhayes/react-use-hubspot-form';
const MyApp = () => (
)
`
`TypeScript
import React from 'react';
import { useHubspotForm } from '@aaronhayes/react-use-hubspot-form';
const MyPage = () => {
const { loaded, error, formCreated } = useHubspotForm({
portalId: 'XXXXXXX',
formId: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
target: '#my-hubspot-form'
});
return (
`
- Introduction of the HubspotProvider component. This needs to be included in your App for useHubspotForm` to work.