Typescript conversion.
This commit is contained in:
11
src/components/hooks/useForceUpdate.ts
Normal file
11
src/components/hooks/useForceUpdate.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
export function useForceUpdate() {
|
||||
const [, update] = useState(Object.create(null));
|
||||
|
||||
return useCallback(() => {
|
||||
update(Object.create(null));
|
||||
}, [update]);
|
||||
}
|
||||
|
||||
export default useForceUpdate;
|
||||
Reference in New Issue
Block a user