Single Page Applications
View sample code and troubleshooting tips for integrating GrowSurf into common JavaScript frameworks such as React and Vue.
GitHub
React
React Component
Example using Classes
class App extends React.Component {
componentDidMount() {
const script = document.createElement('script');
script.src = 'https://app.growsurf.com/growsurf.js?v=2.0.0';
script.setAttribute('grsf-campaign', 'jaoh4t');
script.async = true;
document.head.appendChild(script);
}
render() {
return (
<div>
<div className='App'>REACT + GROWSURF</div>
<div data-grsf-block-form></div>
</div>
)
}
}Example using Effect Hook
Vue
Troubleshooting
Last updated
Was this helpful?