score:0

Accepted answer
const [timeVal, setTimeVal] = useState(null); // This will hold current remaining time

// Declare vars from React Idle Timer hook
const { getRemainingTime, getLastActiveTime } = useIdleTimer({
    timeout: 1000 * 60 * 60, // 1-Hour Idle timeout
    onIdle: handleOnIdle,
    debounce: 500
})

// Declare timer that will store the remaining time
useEffect(() => {
    const interval = setInterval(() => {
        setTimeVal(getRemainingTime());
    }, 1000);
}, []);

// Return JSX
// ----------   

return (
    Remaining: {timeVal}<br/>
);

Related Query

More Query from same tag