Skip to content

Commit

Permalink
Update deprecated defaultProps (closes swiftcarrot#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed May 7, 2024
1 parent 14b66fd commit a4def95
Showing 1 changed file with 13 additions and 29 deletions.
42 changes: 13 additions & 29 deletions src/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ import { getClientPosition } from './utils';
import defaultStyles from './styles';

const Slider = ({
disabled,
axis,
x,
y,
xmin,
xmax,
ymin,
ymax,
xstep,
ystep,
disabled = false,
axis = 'x',
x = 50,
y = 50,
xmin = 0,
xmax = 100,
ymin = 0,
ymax = 100,
xstep = 1,
ystep = 1,
onChange,
onDragStart,
onDragEnd,
xreverse,
yreverse,
styles: customStyles,
xreverse = false,
yreverse = false,
styles: customStyles = {},
...props
}) => {
const container = useRef(null);
Expand Down Expand Up @@ -220,20 +220,4 @@ const Slider = ({
);
};

Slider.defaultProps = {
disabled: false,
axis: 'x',
x: 50,
xmin: 0,
xmax: 100,
y: 50,
ymin: 0,
ymax: 100,
xstep: 1,
ystep: 1,
xreverse: false,
yreverse: false,
styles: {}
};

export default Slider;

0 comments on commit a4def95

Please sign in to comment.