@@ -217,27 +217,38 @@ export class Slider extends PureComponent<SliderProps, SliderState> {
217
217
if ( this . props . value !== prevProps . value ) {
218
218
const newValues = normalizeValue ( this . props , this . props . value ) ;
219
219
220
- this . setState ( {
221
- values : updateValues ( {
222
- values : this . state . values ,
223
- newValues : newValues ,
224
- } ) ,
225
- } , ( ) => {
226
- newValues . forEach ( ( value , i ) => {
227
- const currentValue = this . state . values [ i ] . __getValue ( ) ;
228
- if ( value !== currentValue && this . props . animateTransitions ) {
229
- this . _setCurrentValueAnimated ( value , i ) ;
230
- } else {
231
- this . _setCurrentValue ( value , i ) ;
232
- }
233
- } ) ;
234
- } ) ;
220
+ // eslint-disable-next-line react/no-did-update-set-state
221
+ this . setState (
222
+ {
223
+ values : updateValues ( {
224
+ values : this . state . values ,
225
+ newValues : newValues ,
226
+ } ) ,
227
+ } ,
228
+ ( ) => {
229
+ newValues . forEach ( ( value , i ) => {
230
+ const currentValue = this . state . values [ i ] . __getValue ( ) ;
231
+ if (
232
+ value !== currentValue &&
233
+ this . props . animateTransitions
234
+ ) {
235
+ this . _setCurrentValueAnimated ( value , i ) ;
236
+ } else {
237
+ this . _setCurrentValue ( value , i ) ;
238
+ }
239
+ } ) ;
240
+ } ,
241
+ ) ;
235
242
}
236
243
237
244
// Check for other prop changes that might require state updates, e.g., trackMarks
238
245
if ( this . props . trackMarks !== prevProps . trackMarks ) {
239
- const newTrackMarksValues = normalizeValue ( this . props , this . props . trackMarks ) ;
246
+ const newTrackMarksValues = normalizeValue (
247
+ this . props ,
248
+ this . props . trackMarks ,
249
+ ) ;
240
250
251
+ // eslint-disable-next-line react/no-did-update-set-state
241
252
this . setState ( {
242
253
trackMarksValues : updateValues ( {
243
254
values : this . state . trackMarksValues ,
0 commit comments