Skip to content
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

useTour re-render many times when i proceed to scroll #508

Closed
toduyen opened this issue Sep 29, 2022 · 16 comments
Closed

useTour re-render many times when i proceed to scroll #508

toduyen opened this issue Sep 29, 2022 · 16 comments
Labels
minimal-repro Minimal reproduction needed need-more-info

Comments

@toduyen
Copy link

toduyen commented Sep 29, 2022

I tried putting console.log where useTour() is declared and after each step my component is re-rendered many times and even when scrolling horizontally or vertically is re-rendered.

@toduyen toduyen changed the title useTour re-render many times useTour re-render many times when i proceed to scroll Sep 29, 2022
@elrumordelaluz
Copy link
Owner

Hi @toduyen, thanks for open the Issue.

Mind creating a minimal reproduction in a sandbox in order to allow others to debug your use-case and try to find a solution? Thanks!

@elrumordelaluz
Copy link
Owner

@elrumordelaluz
Copy link
Owner

could you please try updating to the last version?

@toduyen
Copy link
Author

toduyen commented Sep 30, 2022

Hi @elrumordelaluz My latest version is 3.1.4
1

@toduyen
Copy link
Author

toduyen commented Sep 30, 2022

This is the TourProvider. mine. But every time I declare useTour in a certain part, every change like vertical and horizontal scrolling causes re-render as video. @elrumordelaluz
2

@elrumordelaluz
Copy link
Owner

could you please try to upgrade into v3.1.5?

@toduyen
Copy link
Author

toduyen commented Sep 30, 2022

ok bro @elrumordelaluz

@elrumordelaluz
Copy link
Owner

great, please let me know.

@toduyen
Copy link
Author

toduyen commented Sep 30, 2022

even though the multiple render issue has been resolved, I still get the setCurrentStep error and the console.log currentstep doesn't change. @elrumordelaluz with version 3.1.5

@toduyen
Copy link
Author

toduyen commented Sep 30, 2022

Too bad when I change the version it seems that useTour crashes ( setCurrentStep , currentstep ) Not woking @elrumordelaluz

@toduyen
Copy link
Author

toduyen commented Sep 30, 2022

And when I changed to your new version my program crashed a lot. Please help me to solve this problem.
3

@elrumordelaluz
Copy link
Owner

ok, rolled back the last changes, please use v3.1.6 and please give an eye here https://reactour.vercel.app/ where I added a console.log for testing purposes in the same Component where is present useTour hook, and check if has the same behavior than on your case.

@toduyen
Copy link
Author

toduyen commented Sep 30, 2022

ok bro i will try your latest version

@elrumordelaluz
Copy link
Owner

elrumordelaluz commented Sep 30, 2022

did you tried the online demo here https://reactour.vercel.app, looking at the log and making the same changes you made with window sizes and so on? The last version is a roll-back, so it is expected to behave as the previous one.

Please compare your use-case with the online demo.

@elrumordelaluz elrumordelaluz added need-more-info minimal-repro Minimal reproduction needed labels Sep 30, 2022
@toduyen
Copy link
Author

toduyen commented Oct 1, 2022

thank you i made it. because my source code uses the global window.innerWidth object. New resulted in re-rendering above. I have successfully fixed it but I also hope in future reactour updates to limit the re-render when moving to other steps. Thank you very much bro @elrumordelaluz

@elrumordelaluz
Copy link
Owner

Cool, so I am closing this issue, but feel free to re-open or create a new one in any case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minimal-repro Minimal reproduction needed need-more-info
Projects
None yet
Development

No branches or pull requests

2 participants