xcarpentier / rn-tourguide

🚩Make an interactive step by step tour guide for your react-native app (a rewrite of react-native-copilot)
https://xcarpentier.github.io/rn-tourguide/
Other
711 stars 212 forks source link

"undefined is not an object" when tour has ended #123

Open pke opened 1 year ago

pke commented 1 year ago

https://github.com/xcarpentier/rn-tourguide/blob/72ae702217f311d5d5fbf0323e63022b383ba30b/src/components/Modal.tsx#L196

currentStep! is the culprit. It is undefined at that moment and should be better currentStep?.tooltipBottomOffset

The question is, why the code is executed after the tour has finished.

Haseeba393 commented 1 year ago

This piece of code is running whenever you are changing your step, just it adds a condition here that if it is last step which the user has clicked then they are animating it down with opacity 1 to 0.

Haseeba393 commented 1 year ago

I'm also encountering the same error when i'm clicking multiple times fast. Then it gives me the your mentioned error, I did the fix you have written here but on last step (fast clicking on steps) the modal opacity doesn't gone