Skip to content

Commit

Permalink
fix: fix warning about index in the upper scope
Browse files Browse the repository at this point in the history
  • Loading branch information
JonatanSalas committed Nov 3, 2020
1 parent 4f3fb79 commit bb60377
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/StoryPreview/hook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,20 @@ export const useStoryPreview = ({

// TODO: add size property to make it customizable
const getItemLayout = useCallback(
(_, index) => ({
offset: 90 * index,
(_, idx) => ({
offset: 90 * idx,
length: 90,
index,
index: idx,
}),
[]
);

const renderPreviewItem = useCallback(
({ item, index }) => {
({ item, index: idx }) => {
let StoryPreviewItemProps: any = {};

if (getStoryPreviewItemProps) {
StoryPreviewItemProps = getStoryPreviewItemProps(item, index);
StoryPreviewItemProps = getStoryPreviewItemProps(item, idx);
}

return (
Expand Down

0 comments on commit bb60377

Please sign in to comment.