T
T
tarp202022-04-08 19:23:22
React
tarp20, 2022-04-08 19:23:22

Why is the frontend sending a lot of requests to the backend?

my component :

export const GroupList = props => {
  const[groups, setGroups] = useState([]);

useEffect(()=>{
  retrieveGroups();
})

const retrieveGroups = () => {
  BackendService.getAllGroups()
  .then(response => {
    setGroups(response.data);
  })
  .catch(e => {
    console.log(e);
  });
return(...)
}


and for some reason many requests are sent:
625061394494f861026286.png

how to make sure that this does not happen and what affects it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tarp20, 2022-04-08
@tarp20

useEffect(()=>{
  retrieveGroups();
},[])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question