Im attempting to execute Chart js functions in React, but have received errors at every point where 'getElementByID' is used, which says 'null is not an object'. I'm assuming that 'getElementByID' is supposed to be formatted a different way in React, but I haven't been able to find a fix for the errors. Does anyone know how I would format the following lines below to be used in React?
let mathChart = document.getElementById('mathChart').getContext('2d');
.
.
document.getElementById("houseTemp").innerHTML = "$" + currentTemp;
Also they're inside a function that I import to the main js file, perhaps there can be a problem with the way i'm calling them?