mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-11 15:22:29 +02:00
refactor: prepare types for React 19 (#10746)
This commit is contained in:
parent
e9f0641620
commit
f9825af43e
296 changed files with 1105 additions and 915 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue