const Component = () => {
const history = useHistory();
const handler = async () => {
await firstRequest();
await secontRequest();
await thirdRequest();
history.push("/myroute");
}
return (...);
}
const Component = () => {
const history = useHistory();
const handler = async () => {
await Promise.all([
firstRequest(),
secontRequest(),
thirdRequest(),
]);
history.push("/myroute");
}
return (...);
}