I need to add a form to my page. The first time I navigate to the route with this component, it renders normally, but each time I reload the page, the form disappears. Additionally, when I manually disable the cache in my browser and reload the page, the form appears. I receive a CDN script tag and an example of how to implement the form, but it simply doesn’t work.
Tutorial that doesn’t work:
https://ajuda.rdstation.com/s/article/Inserir-formul%C3%A1rio-em-site-criado-em-React?language=en_US
import { useEffect } from 'react';
declare global {
interface Window {
RDStationForms(param1: string, param2: string): void;
}
}
const RdStationForm = () => {
useEffect(() => {
const createForm = () => {
if (window.RDStationForms) {
new window.RDStationForms('newsletter-sampleName-sampleId', 'sampleId').createForm();
}
}
createForm()
}, []);
return <div role="main" id="newsletter-sampleName-sampleId" />;
}
export default RdStationForm;
Reload my page and the form still be visible