You should get the navigate function from useNavigate during render, then call navigate after the async save completes successfully.