Skip to content

Commit

Permalink
Fixed cannot read property snapToNext of null in OnBoarding (#641)
Browse files Browse the repository at this point in the history
* Fixed cannot read property snapToNext of null in OnBoarding

* Added optional chaining
  • Loading branch information
paulsojan authored Feb 2, 2024
1 parent 9e92320 commit 7c9719a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/OnBoarding.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};
Expand Down

0 comments on commit 7c9719a

Please sign in to comment.