An easy way to see how many times components render in class components is the following:
render() {
console.log('component')
return <Component />
}
Is the equivalent in functional components useEffect?
useEffect(() => {
console.log('component');
});
When I call this I notice that 'component' is being printed over and over again. Does this mean that my component is being re-rendered over and over again unnecessarily?