From bb60377cf1aed9b571e9090a75382a3e6c6f692d Mon Sep 17 00:00:00 2001 From: JonatanSalas Date: Mon, 2 Nov 2020 21:59:17 -0300 Subject: [PATCH] fix: fix warning about index in the upper scope --- src/components/StoryPreview/hook.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/StoryPreview/hook.tsx b/src/components/StoryPreview/hook.tsx index 606a152..d910265 100644 --- a/src/components/StoryPreview/hook.tsx +++ b/src/components/StoryPreview/hook.tsx @@ -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 (