aboutsummaryrefslogtreecommitdiff
path: root/src/components/PollsList/PollsList.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/PollsList/PollsList.tsx')
-rw-r--r--src/components/PollsList/PollsList.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/PollsList/PollsList.tsx b/src/components/PollsList/PollsList.tsx
index bf2079a..3eeed2b 100644
--- a/src/components/PollsList/PollsList.tsx
+++ b/src/components/PollsList/PollsList.tsx
@@ -1,4 +1,4 @@
-import React, { useCallback, useState, useMemo } from 'react';
+import React, {useCallback, useState, useMemo, useRef, useEffect} from 'react';
import {
WindowScroller,
AutoSizer,
@@ -25,6 +25,10 @@ const PAGE_SIZE = 10;
const PollsList: React.FC<PropTypes> = ({ polls, mutate }) => {
const [displayCount, setDisplayCount] = useState<number>(PAGE_SIZE);
+ useEffect(()=> {
+ cache.clearAll();
+ },[polls]);
+
const rowRenderer = useCallback(({ index, style, key, parent }) => (
<RenderItem
polls={polls}