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/hooks
File: useFormsScript.ts
import $ from 'jquery';
[0] Fix | Delete
[1] Fix | Delete
import { useEffect, useState } from 'react';
[2] Fix | Delete
import { formsScript } from '../../../constants/leadinConfig';
[3] Fix | Delete
import Raven from '../../../lib/Raven';
[4] Fix | Delete
[5] Fix | Delete
let promise: Promise<string | undefined>;
[6] Fix | Delete
[7] Fix | Delete
function loadFormsScript() {
[8] Fix | Delete
if (!promise) {
[9] Fix | Delete
promise = new Promise((resolve, reject) =>
[10] Fix | Delete
$.getScript(formsScript)
[11] Fix | Delete
.done(resolve)
[12] Fix | Delete
.fail(reject)
[13] Fix | Delete
);
[14] Fix | Delete
}
[15] Fix | Delete
return promise;
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
export default function useFormScript() {
[19] Fix | Delete
const [ready, setReady] = useState(false);
[20] Fix | Delete
[21] Fix | Delete
useEffect(() => {
[22] Fix | Delete
loadFormsScript()
[23] Fix | Delete
.then(() => setReady(true))
[24] Fix | Delete
.catch(error => Raven.captureException(error));
[25] Fix | Delete
}, []);
[26] Fix | Delete
[27] Fix | Delete
return ready;
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function