defaultValue not working in Slider
Trying to set the slider to a default position and I followed the guidelines as best i can tell:
<Slider
step={1000}
defaultValue={10000}
min={0}
max={1000000}
onChange={props.onSliderChange}
value={props.audienceSize}
style={{ marginTop: 10 }}
/>
However, the slider stays in position
Setting a value with the 'value' prop puts the handle at that value. One fix is to update the value prop with every redraw when sliding. That works for me, but I don't know if this is the best solution.
Have this issue as well, defaultValue doesnt work for me
In my case defaultValue works for the first render, but changing the defaultValue does not trigger a new render.
So the fix here may be as simple as to trigger a re-render when defaultValue changes.
same problem, defaultValue on zero position.
It seems that using the defaultValue prop has the downside that it doesn't trigger a render of the component when that has been changed. I would try swapping out defaultValue for just value; that works for me