Skip to content

Commit fe67703

Browse files
committed
fix lint issues
1 parent d62ba58 commit fe67703

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

src/index.tsx

+27-16
Original file line numberDiff line numberDiff line change
@@ -217,27 +217,38 @@ export class Slider extends PureComponent<SliderProps, SliderState> {
217217
if (this.props.value !== prevProps.value) {
218218
const newValues = normalizeValue(this.props, this.props.value);
219219

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+
);
235242
}
236243

237244
// Check for other prop changes that might require state updates, e.g., trackMarks
238245
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+
);
240250

251+
// eslint-disable-next-line react/no-did-update-set-state
241252
this.setState({
242253
trackMarksValues: updateValues({
243254
values: this.state.trackMarksValues,

0 commit comments

Comments
 (0)