Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/leadin/scripts/shared/Form
File: PreviewForm.tsx
import React, { useEffect, useRef } from 'react';
[0] Fix | Delete
import UIOverlay from '../UIComponents/UIOverlay';
[1] Fix | Delete
import { formsScriptPayload, hublet } from '../../constants/leadinConfig';
[2] Fix | Delete
import useFormScript from './hooks/useFormsScript';
[3] Fix | Delete
[4] Fix | Delete
export default function PreviewForm({
[5] Fix | Delete
portalId,
[6] Fix | Delete
formId,
[7] Fix | Delete
}: {
[8] Fix | Delete
portalId: number;
[9] Fix | Delete
formId: string;
[10] Fix | Delete
}) {
[11] Fix | Delete
const inputEl = useRef<HTMLDivElement>(null);
[12] Fix | Delete
const ready = useFormScript();
[13] Fix | Delete
[14] Fix | Delete
useEffect(() => {
[15] Fix | Delete
if (!ready) {
[16] Fix | Delete
return;
[17] Fix | Delete
}
[18] Fix | Delete
if (inputEl.current) {
[19] Fix | Delete
inputEl.current.innerHTML = '';
[20] Fix | Delete
const embedScript = document.createElement('script');
[21] Fix | Delete
embedScript.innerHTML = `hbspt.forms.create({ portalId: '${portalId}', formId: '${formId}', region: '${hublet}', ${formsScriptPayload} });`;
[22] Fix | Delete
inputEl.current.appendChild(embedScript);
[23] Fix | Delete
}
[24] Fix | Delete
}, [formId, portalId, ready, inputEl]);
[25] Fix | Delete
[26] Fix | Delete
return <UIOverlay ref={inputEl} />;
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function