We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e74504 commit 998738bCopy full SHA for 998738b
src/app/components/useForceUpdate.ts
@@ -2,7 +2,7 @@ import { useState } from 'react';
2
3
// This function will force a change in state and cause a re-render of the component.
4
// The state information is irrelevant but an update is needed to force a re-render
5
-export default function useForceUpdate() {
+export default function useForceUpdate(): () => number {
6
const [, setValue] = useState(0);
7
- return () => setValue((value) => value + 1);
+ return ():number => setValue((value:number): number => value + 1);
8
}
0 commit comments