umami.waylonwalker.com/hooks/useForceUpdate.js
WaylonWalker 4047a7ec23 Initial commit
Created from https://vercel.com/new
2021-12-08 18:25:42 +00:00

9 lines
224 B
JavaScript

import { useCallback, useState } from 'react';
export default function useForceUpdate() {
const [, update] = useState(Object.create(null));
return useCallback(() => {
update(Object.create(null));
}, [update]);
}