callstack/react-native-slider

Cannot read properties of undefined (reading 'toFixed')

rwilliamson1 opened this issue · 4 comments

Environment

  • which version of react & react-native are you using?
  • react: 18.3.1
  • react-native: 0.74.2
  • react-native-web: 0.19.10

Description

When the slider is used with a step prop, when it is moved down to 0 it causes the error "Cannot read properties of undefined (reading 'toFixed')"


Screenshot 2024-07-10 at 2 09 58 PM

Reproducible Demo

The combination of using the step prop with the value going from a positive value down to 0 causes the error.


https://snack.expo.dev/jlLsyHnEs_ZzE3sODCTSB

I'm experiencing the same issue. It was working fine up to v4.4.2. The problem started occurring after updating to v4.4.3.

having the same problem here...

Looks like this is the culprit (changing undefined to 0 stops the error) - Obviously any props.value of zero is false in the ternary:

image

is this fixed - I still get an error when setting the slider to 0.
I have had to revert to 4.4.2

ah...hasn't been released yet.....