umami/hooks/useForceUpdate.js

12 lines
248 B
JavaScript
Raw Normal View History

import { useCallback, useState } from 'react';
2023-05-18 08:20:06 +02:00
export function useForceUpdate() {
const [, update] = useState(Object.create(null));
return useCallback(() => {
update(Object.create(null));
}, [update]);
}
2023-05-18 08:20:06 +02:00
export default useForceUpdate;