Component render multiple times if I use a component multiple time in another component

I have used a component (product) 8 times in another component (home page). I run an API in product component. If get any error, I am showing it using useEffect. But the error show 8 time in component.
The error should show only one time. Is there any solution for this ?