The second argument of useEffect was not correctly defined.
So the code in useEffect was executed on every rendering.
The variables including the functions used in useEffect should be defined in the second argument.
Then the code in useEffect is executed on the first rendering and when the variables are changed, which is the correct behavior.
What the title looks like with this change (for example):
PR to fix this issue:
https://github.com/chatch/stellarexplorer/issues/577
Problem (and fix):
The second argument of
useEffect
was not correctly defined. So the code inuseEffect
was executed on every rendering. The variables including the functions used inuseEffect
should be defined in the second argument. Then the code inuseEffect
is executed on the first rendering and when the variables are changed, which is the correct behavior.What the title looks like with this change (for example):