Skip to content

Commit 3a06a1b

Browse files
yuanjackie1jasnoo
authored andcommitted
added typing to useForceUpdate.ts
1 parent b35e3f2 commit 3a06a1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/components/useForceUpdate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useState } from 'react';
22

33
// This function will force a change in state and cause a re-render of the component.
44
// The state information is irrelevant but an update is needed to force a re-render
5-
export default function useForceUpdate() {
5+
export default function useForceUpdate(): () => number {
66
const [, setValue] = useState(0);
7-
return () => setValue((value) => value + 1);
7+
return ():number => setValue((value:number): number => value + 1);
88
}

0 commit comments

Comments
 (0)