-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling start() on useEffect does not register/use all steps, only the first one #322
Comments
setTimeout doesn't work for me. I am trying to set false if displayed already. |
in my case, it even doesn't trigger. I have to trigger manually by touch event after a second It seems sometimes useEffect init before all children-in-order finish, did causing problem this is my fix: useEffect(() => {
// Create a debounced version of the start function
const debouncedStart = debounce(() => {
start();
}, 1000);
// Call the debounced start function
debouncedStart();
// Clean up the debounced function
return () => {
debouncedStart.cancel();
};
}, [totalStepsNumber]); depends on "totalStepsNumber" is the key |
what is the totalStepsNumber here.give full code |
Try my solution:
|
I am noticing the same issue. It seems like this library isn't maintained much anymore though :( |
any solution on how can this be fixed? Creating a debounced version of the start function didn't worked for me |
Maybe instead of one, it should have multiple contexts? |
Current Behavior
Calling start on useEffect does not register steps. After clicking "next" it moves to next walkthrouable item, but in the current step always displays the first step content.
However,
totalSteps
displays correct number of steps.Expected behavior/code
Steps are registered and "next" press works correctly.
Environment
react-native-copilot
: [3.3.2]react-native
: [71.14]react-native-svg
: [14.0.0]Possible Solution
I was able to solve this by adding timeout of 3s in the useEffect.
setTimeout(() => { start() }, 3000
Additional context/Screenshots
I don't know why it happens, any idea how we can fix it?
The text was updated successfully, but these errors were encountered: