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

Prevent the app from freezing when the index prop supplied is of type string #216

Closed
igordanchenko opened this issue Dec 2, 2023 Discussed in #213 · 1 comment
Closed
Labels
bug Something isn't working released Implemented and released

Comments

@igordanchenko
Copy link
Owner

Discussed in #213

Originally posted by jgudo December 1, 2023
It is clearly stated in docs that the index prop only accepts number type. However, there are instance where the index pass comes from html data attributes like this example codesandbox.

If you would change the line from onClickImage method line 25, setActiveIndex(+idx || 0);, into setActiveIndex(idx || 0); removing the unary + operator or unparsing the string, the app would freeze or become unresponsive.
It would be better if we can throw an error if the index is of type string to prevent the app from freezing.

Copy link

github-actions bot commented Dec 2, 2023

🎉 This issue has been resolved in version 3.15.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Implemented and released label Dec 2, 2023
@igordanchenko igordanchenko added the bug Something isn't working label Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Implemented and released
Projects
None yet
Development

No branches or pull requests

1 participant