CMS Development

Teun
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Mini React App in Hubspot not working

SOLVE

Hi guys,

 

We created a small React app which fetches some posts from the Hubspot API and displays these posts with a filter on a Hubspot page.

We are using the local development stack to sync our code to Hubspot. We build the app using Preact and compile using Webpack.  (https://designers.hubspot.com/docs/tools/local-development)

Hubspot somehow isn't always showing the correct state. We console log the state and the logs are showing the correct data. However, the app doesn't reflects these changes most of the time. It's like it gets stuck on the first state when the data isn't loaded quick enough.

 

We tried the exact same build locally, and it is working just fine. So I was thinking the Hubspot cache could be an issue here. Anyone else experienced something similar? If we can not resolve this issue and use React in Hubspot, we would have to go back to WordPress or a different CMS.

 

Support doesn't have the answer so maybe the community can help us out! 



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


0 Upvotes
1 Accepted solution
Teun
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Mini React App in Hubspot not working

SOLVE

If anyone has this problem as well, the theme-foundation-v1-0.min.js script loaded by Hubspot is blocking React from showing the correct state. We discovered this was the issue when we tried the app in a Sandbox portal and everything was working just fine.

Blocking or removing this script will resolve the issue. 

Big shoutout to Zack from Hubspot who took a lot of time to debug this issue with us.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


View solution in original post

0 Upvotes
1 Reply 1
Teun
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Mini React App in Hubspot not working

SOLVE

If anyone has this problem as well, the theme-foundation-v1-0.min.js script loaded by Hubspot is blocking React from showing the correct state. We discovered this was the issue when we tried the app in a Sandbox portal and everything was working just fine.

Blocking or removing this script will resolve the issue. 

Big shoutout to Zack from Hubspot who took a lot of time to debug this issue with us.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


0 Upvotes