You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
question about the decisions made in the repository
question about how to use this project
Summary
When using this library with GatsbyJS, depending on what's included in the page, will cause undefined errors to be thrown. The reason for this is because the library loads the script in asynchronously and because it's to the body. This is because with Gatsby, it is rendering the page server side, setting the state as loaded, then when the page is actually loaded into the browser, it is passing the "loaded" check before it's actually been loaded.
I'm submitting a ...
bug report
feature request
question about the decisions made in the repository
question about how to use this project
Summary
When using this library with GatsbyJS, depending on what's included in the page, will cause undefined errors to be thrown. The reason for this is because the library loads the script in asynchronously and because it's to the body. This is because with Gatsby, it is rendering the page server side, setting the state as loaded, then when the page is actually loaded into the browser, it is passing the "loaded" check before it's actually been loaded.
If there was an option to load this synchronously and to add the script to the head (as it supposedly should do as per comment https://github.com/aaronhayes/react-use-hubspot-form/blob/master/src/HubspotProvider.tsx#L17), then this will no longer be an issue.
A simple example to replicate this behaviour:
The text was updated successfully, but these errors were encountered: