Prevent premature calls to useNavigate() from failing with "You should call navigate() in a React.useEffect(), not when your component is first rendered".
This warning happens even when navigate() is called from a useEffect(), because that effect is called before useNavigate's internal effect (parents' effects are invoked after children's effects).
To get around this, enqueue premature useNavigate() calls, and process the queue in a useEffect() (which is called afteruseNavigate's effect).
Prevent premature calls to
useNavigate()
from failing with "You should call navigate() in a React.useEffect(), not when your component is first rendered".This warning happens even when
navigate()
is called from auseEffect()
, because that effect is called before useNavigate's internal effect (parents' effects are invoked after children's effects).To get around this, enqueue premature
useNavigate()
calls, and process the queue in auseEffect()
(which is called afteruseNavigate
's effect).Fixes #211.