Replies: 2 comments 2 replies
-
did you tried any of the sandboxes, specially those using |
Beta Was this translation helpful? Give feedback.
2 replies
-
Faced this issue and a sort a similar one as well. Sometimes after a Solved it with a context which introduces one more Roughly the code looks like this: const [controlledStep, setControlledStep] = useState(0);
const { setCurrentStep} = useTour();
useEffect(() => {
if (controlledStep === 1) {
// Do something which changes position of elements/brings them into DOM
setTimeout(() => {
setCurrentStep(controlledStep);
}, 300); // 300ms is a rough durtion figured out by hit and trial
return;
}
}, [controlledStep]); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an app with multiple screens and sub-screens (via React Router but also just via other conditional logic) and would like to show tour steps only when their associated component / DOM element is onscreen. Like, if step 3 is connected to
<div data=tour="Something">
then I'd like to be able to open the tour and simply have it not show if thatdiv
isn't present.I can think of various ways to wrap Reactour to make that happen but wondered if there's a best practice here. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions