import CountUp from "react-countup";
import VisibilitySensor from 'react-visibility-sensor';
function ... () {
<CountUp end={number.blah(get from api)} redraw={true}>
{({ countUpRef, start }) => (
<VisibilitySensor onChange={start} delayedCall>
<span ref={countUpRef} />
</VisibilitySensor>
)}
</CountUp>
}
I didn't use hooks, just used them directly in the main component.
Warning: Failed prop type: The prop end
is marked as required in CountUp
, but its value is undefined
.
Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of VisibilitySensor which is inside StrictMode. Instead, add a ref directly to the element you want to reference.
These are the errors that occurred and how can I fix them please help