Skip to content

trying to deal with possible target errors #1100

Answered by gilbarbara
RenanMev asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @RenanMev
With the uncontrolled flow, the callback usually receives updates after something has happened. In the case of a missing target, the internal index has already been increased.

For your case I'd suggest to use the run and stepIndex props to control the tour yourself.
In the step_after action, get the next step and check if it's mounted. If it is just increase the stepIndex and let it continue. Otherwise, make your changes before continuing.
Check the Controlled example code in the demo.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RenanMev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants