Android: StackOverflow when lowerLimit
is greater than upperLimit
(and, on some devices, when the slider first loads)
#571
Labels
Environment
are you using the new architecture? No
which version of react & react-native are you using?
Description
When
lowerLimit
is greater thanupperLimit
,react-native-slider
can crash with aStackOverflowException
.Important
This is a reproducable version of this downstream bug report.
The downstream bug report happens while a slider is loading, even though
lowerLimit
andupperLimit
are not set explicitly. Rather, it happens because React Native sets props one-by-one, which can lead to a state wherelowerLimit > upperLimit
(andrealLowerLimit < realUpperLimit
, sosetProgress
works).I have been unable to reproduce this user's issue locally, however, they have posted logs which show the order in which props are updated (and recursion depth). This patch generates the logs.
Logcat output
Note: Top of stack trace lost due to
Reproducible Demo
The following diff, applied to this repository, can be used to reproduce the issue (tested on Android 7 and 13):
The text was updated successfully, but these errors were encountered: