feat: add periodic interval using useEffect hook

This commit is contained in:
dancingCycle 2022-09-16 14:24:10 +02:00
parent 16a94e936d
commit 3f5a901560
1 changed files with 10 additions and 1 deletions

View File

@ -1,7 +1,16 @@
import React from 'react';
import React, {useEffect} from 'react';
import Map from '../components/map/map';
export default function MapPage() {
useEffect(()=>{
const intervalCall=setInterval(()=>{
console.log('get data');
}, 30000);
return ()=>{
/*clean up*/
clearInterval(intervalCall);
};
},[]);
return (
<>
{/*TODO remove debugging*/}