aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/components/hooks/useReloadKey.ts
blob: 4f63f914db3a0a356f3c521016d352355fb7298e (plain)
1
2
3
4
5
6
7
8
9
import { useState } from "react";

export default function useReloadKey(): [
  key: number | string,
  reload: () => void,
] {
  const [key, setKey] = useState(0);
  return [key, () => setKey((k) => k + 1)];
}