refactor: declare all props as interfaces (#6730)

* refactor: declare all props as interfaces

* fix

* fix...
This commit is contained in:
Joshua Chen 2022-02-21 11:52:11 +08:00 committed by GitHub
parent 5555290edc
commit c38200ba5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 44 additions and 55 deletions

View file

@ -25,10 +25,10 @@ declare module '@docusaurus/plugin-pwa' {
}
declare module '@theme/PwaReloadPopup' {
export type PwaReloadPopupProps = {
export interface Props {
readonly onReload: () => void;
};
}
const PwaReloadPopup: (props: PwaReloadPopupProps) => JSX.Element;
const PwaReloadPopup: (props: Props) => JSX.Element;
export default PwaReloadPopup;
}

View file

@ -9,11 +9,11 @@ import React, {useState} from 'react';
import clsx from 'clsx';
import Translate, {translate} from '@docusaurus/Translate';
import type {PwaReloadPopupProps} from '@theme/PwaReloadPopup';
import type {Props} from '@theme/PwaReloadPopup';
import styles from './styles.module.css';
function PwaReloadPopup({onReload}: PwaReloadPopupProps): JSX.Element | false {
function PwaReloadPopup({onReload}: Props): JSX.Element | false {
const [isVisible, setIsVisible] = useState(true);
return (