You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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);
, intosetActiveIndex(idx || 0);
removing theunary + 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.
The text was updated successfully, but these errors were encountered: