mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-31 23:40:39 +02:00
refactor: improve internal typing (#6507)
* refactor: improve internal typing * fix * fix test
This commit is contained in:
parent
58e07a6796
commit
2553f1fb5a
14 changed files with 165 additions and 132 deletions
|
@ -29,6 +29,6 @@ export function useDynamicCallback<T extends (...args: never[]) => unknown>(
|
|||
ref.current = callback;
|
||||
}, [callback]);
|
||||
|
||||
// @ts-expect-error: TODO, not sure how to fix this TS error
|
||||
// @ts-expect-error: TS is right that this callback may be a supertype of T, but good enough for our use
|
||||
return useCallback<T>((...args) => ref.current(...args), []);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue