Skip to content

Commit

Permalink
[Slider] Update TypeScript demo to cast types to values (mui#16957)
Browse files Browse the repository at this point in the history
  • Loading branch information
allypally authored and oliviertassinari committed Aug 10, 2019
1 parent 0b299e1 commit fd8acdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/src/pages/components/slider/ContinuousSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const useStyles = makeStyles({

export default function ContinuousSlider() {
const classes = useStyles();
const [value, setValue] = React.useState<number | number[]>(30);
const [value, setValue] = React.useState<number>(30);

const handleChange = (event: any, newValue: number | number[]) => {
setValue(newValue);
setValue(newValue as number);
};

return (
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/slider/RangeSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ function valuetext(value: number) {

export default function RangeSlider() {
const classes = useStyles();
const [value, setValue] = React.useState<number | number[]>([20, 37]);
const [value, setValue] = React.useState<number[]>([20, 37]);

const handleChange = (event: any, newValue: number | number[]) => {
setValue(newValue);
setValue(newValue as number[]);
};

return (
Expand Down

0 comments on commit fd8acdf

Please sign in to comment.