mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
fix type errors
This commit is contained in:
parent
20fd0afc0e
commit
ca7ef20d06
4 changed files with 4 additions and 5 deletions
|
@ -11,7 +11,7 @@ import {useMutationObserver} from './useMutationObserver';
|
|||
// Callback fires when the "hidden" attribute of a tabpanel changes
|
||||
// See https://github.com/facebook/docusaurus/pull/7485
|
||||
function useTabBecameVisibleCallback(
|
||||
codeBlockRef: RefObject<HTMLPreElement>,
|
||||
codeBlockRef: RefObject<HTMLPreElement | null>,
|
||||
callback: () => void,
|
||||
) {
|
||||
const [hiddenTabElement, setHiddenTabElement] = useState<
|
||||
|
@ -53,7 +53,7 @@ function useTabBecameVisibleCallback(
|
|||
}
|
||||
|
||||
export function useCodeWordWrap(): {
|
||||
readonly codeBlockRef: RefObject<HTMLPreElement>;
|
||||
readonly codeBlockRef: RefObject<HTMLPreElement | null>;
|
||||
readonly isEnabled: boolean;
|
||||
readonly isCodeScrollable: boolean;
|
||||
readonly toggle: () => void;
|
||||
|
|
|
@ -44,7 +44,7 @@ export function useEvent<T extends (...args: never[]) => unknown>(
|
|||
* Gets `value` from the last render.
|
||||
*/
|
||||
export function usePrevious<T>(value: T): T | undefined {
|
||||
const ref = useRef<T>();
|
||||
const ref = useRef<T>(undefined);
|
||||
|
||||
useIsomorphicLayoutEffect(() => {
|
||||
ref.current = value;
|
||||
|
|
|
@ -52,7 +52,7 @@ function useSkipToContent(): {
|
|||
* so that keyboard navigators can instantly interact with the link and jump
|
||||
* to content.
|
||||
*/
|
||||
containerRef: React.RefObject<HTMLDivElement>;
|
||||
containerRef: React.RefObject<HTMLDivElement | null>;
|
||||
/**
|
||||
* Callback fired when the skip to content link has been clicked.
|
||||
* It will programmatically focus the main content.
|
||||
|
|
|
@ -199,7 +199,6 @@ function DocSearch({
|
|||
})),
|
||||
).current;
|
||||
|
||||
// @ts-expect-error: TODO fix lib issue after React 19, using JSX.Element
|
||||
const resultsFooterComponent: DocSearchProps['resultsFooterComponent'] =
|
||||
useMemo(
|
||||
() =>
|
||||
|
|
Loading…
Add table
Reference in a new issue