1 import { useMemo, useState } from 'react';
3 export const useRerender = (prefix: string = 'key'): [string, () => void] => {
4 const [renderKey, setRenderKey] = useState(0);
5 return useMemo(() => [`${prefix}-${renderKey}`, () => setRenderKey((key) => key + 1)], [renderKey]);