Getting this:
-React Hook useEffect has a missing dependency: 'getData'.
Either include it or remove the dependency array
useEffect(() => {
setInterval(() => {
getData();
}, 300);
}, []);
and in getData calling the api
const getData =useCallback( () => {
axios.get(`${API_ENDPOINT}/api`,
{
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Access-control-allow-origin': '*'
},
auth: {
username: 'admin',
password: 'password'
}
}).then(response => {
setIsLoading(true);
setPlaylistData(response.data.Clips);
}).catch(error => {
console.log("Error In GET Data", error);
});
},[setPlaylistData])