From 7c9719af929e89b380e09b36c13ea0061701255f Mon Sep 17 00:00:00 2001 From: Paul Elias Sojan Date: Fri, 2 Feb 2024 22:20:39 +0530 Subject: [PATCH] Fixed cannot read property snapToNext of null in OnBoarding (#641) * Fixed cannot read property snapToNext of null in OnBoarding * Added optional chaining --- src/components/OnBoarding.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/OnBoarding.jsx b/src/components/OnBoarding.jsx index 9cad092a..1a623d14 100644 --- a/src/components/OnBoarding.jsx +++ b/src/components/OnBoarding.jsx @@ -57,7 +57,7 @@ export const OnBoarding = ({ const handleOnPress = () => { if (activeIndex !== slides.length - 1) { - onBoardingRef.current.snapToNext(); + setTimeout(() => onBoardingRef.current?.snapToNext(), 250); setActiveIndex(onBoardingRef.current._activeItem); } else onComplete(); };