Skip to content

Commit

Permalink
fix: image index
Browse files Browse the repository at this point in the history
  • Loading branch information
kokororin committed Apr 19, 2020
1 parent b28dbdb commit 69eff00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/ImageBox.tsx
Expand Up @@ -118,7 +118,7 @@ interface IImageBoxProps {

const ImageBox: React.FunctionComponent<IImageBoxProps> = props => {
const classes = useStyles();
const [index, setIndex] = React.useState(0);
const [index, setIndex] = React.useState(props.index);

const onPrev = () =>
setIndex((index + props.items.length - 1) % props.items.length);
Expand Down

0 comments on commit 69eff00

Please sign in to comment.