Comments (2)
Thanks @snelsi. That makes sense - I wasn't sure if it'd be possible to use a getServerSideProps
functionality to load the script prior to the component mounting. Not a big deal, just learning!
from next-hubspot.
- It's impossible to render Hubspot form on the server. It uses global
window
methods internally. - When you are mounting a form, your
targetId
element should always be present on the page. Don't hide it behind conditional logic. - You can add custom Loading component like this:
const { loaded, error } = useHubspotForm({
target: "targetId"
})
return (
<>
<div id="targetId" />
{!loaded && !error && <MyCustomLoader />}
</>
)
from next-hubspot.
Related Issues (8)
- Improve Hubspot types
- Next.js 13 app directory support HOT 7
- How to disable tracking or cookies dropped by hubspot? HOT 1
- Form not rendering with Next.js 14.0.1 HOT 10
- Two seperate forms can't be loaded twice on the same page, only one is shown? HOT 1
- Configuration option for region is not included in HubspotFormProps HOT 2
- Error with HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-hubspot.