GithubHelp home page GithubHelp logo

snelsi / next-hubspot Goto Github PK

View Code? Open in Web Editor NEW
58.0 1.0 9.0 302 KB

⭐Embed Hubspot forms in your Next.js application

License: MIT License

Shell 0.34% TypeScript 95.71% JavaScript 3.94%
hubspot forms hooks nextjs react

next-hubspot's People

Contributors

hdsheena avatar mcortes19 avatar snelsi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

next-hubspot's Issues

Error with

Describe the bug
When i wrap my app in the provider i automatically get an error message
I'm on nextJS 12

export default function MyApp({ Component, pageProps }) {
return (


<Component {...pageProps} />


);
}

Here is the error :
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
at HubspotProvider (file:///Users/pierre/Documents/GitHub/projetc/node_modules/next-hubspot/lib/HubspotProvider.js:17:28)
at AuthProvider (webpack-internal:///./lib/auth.tsx:26:19)
at MyApp (webpack-internal:///./pages/_app.tsx:25:18)
at StyleRegistry (/Users/pierre/Documents/GitHub/projetc/node_modules/styled-jsx/dist/index/index.js:671:34)
at AppContainer (/Users/pierre/Documents/GitHub/projetc/node_modules/next/dist/server/render.js:415:29)
at AppContainerWithIsomorphicFiberStructure (/Users/pierre/Documents/GitHub/projetc/node_modules/next/dist/server/render.js:447:57)
at div
at Body (/Users/pierre/Documents/GitHub/projetc/node_modules/next/dist/server/render.js:715:21)

Capture d’écran 2024-02-23 à 16 15 18

If you have any idea or recommandation :)

Configuration option for region is not included in HubspotFormProps

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Add a component and use the Region property
  2. I get a typescript error saying: Property 'region' does not exist on type 'IntrinsicAttributes & HubspotFormProps'

Expected behavior
A clear and concise description of what you expected to happen.

Enable SSR for Hubspot Forms

Is your feature request related to a problem? Please describe.
I've noticed that when a form is conditionally rendered in Next.js, the HubspotForm component will often render before the form is actually loaded. See GIF at bottom.

Describe the solution you'd like
I'm hopeful that a preload prop could be added to allow for preloading of the form, which would prevent the blank space from appearing.

Describe alternatives you've considered
I looked into adding a "Loading" indicator, but the loading prop appears to display true before the form is displayed

2023-09-14 16 45 46 2

Form not rendering with Next.js 14.0.1

Describe the bug

Upgrading to next 14.0.1 is causing our form to no longer load.

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Tested on Chrome and Safari

Additional context

I added some logging for useHubspotForm:

 formCreated false
 error false
 loaded false

So it looks like the form isn't loading. I can confirm that the hubspot script tag is present in the html.

The onLoad callback for the HubspotProvider is also called

Improve Hubspot types

It would be nice to improve typing of Hubspot fields in src/hubspot.types.ts.
Currently, most of the fields are loosely marked as 'unknown function' or 'unknown object'.
My knowledge of Hubspot is too superficial to decipher the types of the arguments by the function name.

Official documentation:
https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options

You can view all fields in your browser by calling console.log(window.hubspot) and console.log(window.hbspt).

image

image

Next.js 13 app directory support

I've tried implementing this with the experimental app directory in Next.js 13 using a layout.tsx and page.tsx - would be really useful to see how to implement next-hubspot with this situation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.