refactor: prepare types for React 19 (#10746)

This commit is contained in:
Sébastien Lorber 2024-12-06 18:03:04 +01:00 committed by GitHub
parent e9f0641620
commit f9825af43e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
296 changed files with 1105 additions and 915 deletions

View file

@ -76,6 +76,8 @@ declare module '@docusaurus/plugin-pwa' {
}
declare module '@theme/PwaReloadPopup' {
import type {ReactNode} from 'react';
export interface Props {
/**
* The popup should call this callback when the `reload` button is clicked.
@ -84,5 +86,5 @@ declare module '@theme/PwaReloadPopup' {
*/
readonly onReload: () => void;
}
export default function PwaReloadPopup(props: Props): JSX.Element;
export default function PwaReloadPopup(props: Props): ReactNode;
}

View file

@ -5,14 +5,14 @@
* LICENSE file in the root directory of this source tree.
*/
import React, {useState} from 'react';
import React, {type ReactNode, useState} from 'react';
import clsx from 'clsx';
import Translate, {translate} from '@docusaurus/Translate';
import type {Props} from '@theme/PwaReloadPopup';
import styles from './styles.module.css';
export default function PwaReloadPopup({onReload}: Props): JSX.Element | false {
export default function PwaReloadPopup({onReload}: Props): ReactNode {
const [isVisible, setIsVisible] = useState(true);
return (