Single Page Applications
View sample code and troubleshooting tips for integrating GrowSurf into common JavaScript frameworks such as React and Vue.
Last updated
Was this helpful?
View sample code and troubleshooting tips for integrating GrowSurf into common JavaScript frameworks such as React and Vue.
Last updated
Was this helpful?
.
Check out the GitHub sample code for React and our .
To initialize GrowSurf asynchronously within your SPA, simply include the following code within your lifecycle event.
This snippet of code will only add the GrowSurf Universal Code when a visitor is brought to a page within your site that includes the component with this code. Once the script has been added successfully and , you will then have the ability to add any (s) you would like within your components JSX.
.
If you experience issues with embeddable elements rendering on the page (depending on how URL routes are handled in your SPA, this behavior will typically be seen when you refresh the webpage with the absolute route) you will need to call to re-initialize GrowSurf to make the embeddable elements render.