mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-30 06:50:36 +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
|
@ -17,6 +17,7 @@ declare module '@docusaurus/theme-live-codeblock' {
|
|||
}
|
||||
|
||||
declare module '@theme/Playground' {
|
||||
import type {ReactNode} from 'react';
|
||||
import type {Props as BaseProps} from '@theme/CodeBlock';
|
||||
import type {LiveProvider} from 'react-live';
|
||||
|
||||
|
@ -27,7 +28,7 @@ declare module '@theme/Playground' {
|
|||
// Allow empty live playgrounds
|
||||
children?: string;
|
||||
}
|
||||
export default function Playground(props: LiveProviderProps): JSX.Element;
|
||||
export default function Playground(props: LiveProviderProps): ReactNode;
|
||||
}
|
||||
|
||||
declare module '@theme/ReactLiveScope' {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import React, {type ReactNode} from 'react';
|
||||
import clsx from 'clsx';
|
||||
import useIsBrowser from '@docusaurus/useIsBrowser';
|
||||
import {LiveProvider, LiveEditor, LiveError, LivePreview} from 'react-live';
|
||||
|
@ -23,7 +23,7 @@ import type {ThemeConfig} from '@docusaurus/theme-live-codeblock';
|
|||
|
||||
import styles from './styles.module.css';
|
||||
|
||||
function Header({children}: {children: React.ReactNode}) {
|
||||
function Header({children}: {children: ReactNode}) {
|
||||
return <div className={clsx(styles.playgroundHeader)}>{children}</div>;
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ export default function Playground({
|
|||
children,
|
||||
transformCode,
|
||||
...props
|
||||
}: Props): JSX.Element {
|
||||
}: Props): ReactNode {
|
||||
const {
|
||||
siteConfig: {themeConfig},
|
||||
} = useDocusaurusContext();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue