refactor: unify export directive style (#6751)

This commit is contained in:
Joshua Chen 2022-02-24 17:25:17 +08:00 committed by GitHub
parent 0c807b3501
commit 0d14470d54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 315 additions and 510 deletions

View file

@ -34,7 +34,11 @@ export type DetailsProps = {
summary?: ReactElement;
} & ComponentProps<'details'>;
function Details({summary, children, ...props}: DetailsProps): JSX.Element {
export default function Details({
summary,
children,
...props
}: DetailsProps): JSX.Element {
const isBrowser = useIsBrowser();
const detailsRef = useRef<HTMLDetailsElement>(null);
@ -96,5 +100,3 @@ function Details({summary, children, ...props}: DetailsProps): JSX.Element {
</details>
);
}
export default Details;

View file

@ -122,7 +122,9 @@ export type TOCHighlightConfig = {
maxHeadingLevel: number;
};
function useTOCHighlight(config: TOCHighlightConfig | undefined): void {
export default function useTOCHighlight(
config: TOCHighlightConfig | undefined,
): void {
const lastActiveLinkRef = useRef<HTMLAnchorElement | undefined>(undefined);
const anchorTopOffsetRef = useAnchorTopOffsetRef();
@ -179,5 +181,3 @@ function useTOCHighlight(config: TOCHighlightConfig | undefined): void {
};
}, [config, anchorTopOffsetRef]);
}
export default useTOCHighlight;