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
745 stars 214 forks source link

Different tours on the same screen and same component does not work #152

Open taniibarra opened 8 months ago

taniibarra commented 8 months ago

I need to show two different tours on the same screen, same component and same user, but at different times. When I import the controller and pass a different key to the other controller, it does not open any tour. How do I solve this? Example:

const { canStart, start, eventEmitter } = useTourGuideController('collaborators');

const { canStart, start, eventEmitter, tourKey, getCurrentStep } = useTourGuideController('onboarding');

@xcarpentier

PriyavKaneria commented 4 months ago

You can do something like

const { canStart, start, eventEmitter } =
useTourGuideController('collaborators');

const { canStart: canStartOnboarding, start: startOnboarding, eventEmitter: eventEmitterOnboarding, tourKey: tourKeyOnboarding, getCurrentStep: getCurrentStepOnboarding } =
useTourGuideController('onboarding');

and then use start() for collaborators and startOnboarding() for onboarding