From b5bffe4a0d5beaf57cb8ce4137f6bfaeddce77de Mon Sep 17 00:00:00 2001 From: Nilotpal <50769314+Nilotpal35@users.noreply.github.com> Date: Tue, 11 Jul 2023 22:11:54 +0530 Subject: [PATCH] Update EventDetail.js while using defer and Await from react-router-dom a instant redirect gives a error. Thats why i introduced this 1000 ms delay before redirecting. --- code/32-finished/frontend/src/pages/EventDetail.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/32-finished/frontend/src/pages/EventDetail.js b/code/32-finished/frontend/src/pages/EventDetail.js index 00036f2890..41e0544372 100644 --- a/code/32-finished/frontend/src/pages/EventDetail.js +++ b/code/32-finished/frontend/src/pages/EventDetail.js @@ -90,5 +90,7 @@ export async function action({ params, request }) { } ); } + await new Promise((res) => setTimeout(res, 1000)); return redirect('/events'); } +