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

Conditionally enable/disable tracking? #14

Closed
Nantris opened this issue Dec 3, 2017 · 5 comments
Closed

Conditionally enable/disable tracking? #14

Nantris opened this issue Dec 3, 2017 · 5 comments

Comments

@Nantris
Copy link

Nantris commented Dec 3, 2017

This is an awesome package and thank you very much for it.

I am using it in a case where I only need to track the cursor in very select circumstances, and I'd love a way to disable the tracking when it's not needed to reduce re-renders.

I can conditionally load it, but that means unmounting and remounting the child components which has some side effects. Is there anything I can do about CPU usage?

Thanks again very much.

@ethanselzer
Copy link
Owner

Hi @slapbox - Thanks for your kind words and for your suggestion. I very much appreciate it. Having a disable feature seems like a useful option. I will get to work on it and post back here when it is ready.

@Nantris
Copy link
Author

Nantris commented Dec 4, 2017

@ethanselzer I'm glad you like the idea and thanks again for the great project and all your work!

@ethanselzer
Copy link
Owner

@slapbox - Support for enabling and disabling has landed in v2.3.0. Please give it a try and let me know your thoughts. Thanks!

@ethanselzer
Copy link
Owner

@slapbox - I'm going to close this as fixed. Thanks again for opening the issue and raising my awareness to the use case. I really appreciate it. If you find react-cursor-position useful, please consider starring it on GitHub. Starring helps to grow the project, which is good for everyone.

@ethanselzer
Copy link
Owner

Fixed by v2.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants