Mini React App in Hubspot not working

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. (Install the HubSpot CLI - HubSpot docs)

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!

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.