Skip to content

Commit 368a0e8

Browse files
authored
Added recommendations around with major step generation
1 parent e369d98 commit 368a0e8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,13 @@ Feel free to contribute to this part of the documentation.
112112
| minMarkerOverlapStepDistance | 0 | number | if this is > 0 and allowOverlap is false, this value will determine the closest two markers can come to each other (in steps, not pixels). This can be used for cases where you have two markers large cursors and you don't want them to overlap. Note that markers will still overlap at the start if starting values are too near. CANNOT be combined with minMarkerOverlapDistance |
113113
| imageBackgroundSource | undefined | string | Specifies the source as required by [ImageBackground](https://facebook.github.io/react-native/docs/imagebackground)|
114114
| testID | | string | Used to locate this view in end-to-end tests. |
115+
116+
# Recommendations
117+
118+
For very large min = 0 & max = 99999999 and very small step = 1, the step generation loop generates very large array which can causes a crash. Its better to dynamically generate a step size in those cases.
119+
120+
```js
121+
step = Math.round(Math.abs(max - min) / 100)
122+
```
123+
124+
Credit https://github.com/ptomasroos/react-native-multi-slider/issues/281#issuecomment-1700770841

0 commit comments

Comments
 (0)