Skip to content

Commit

Permalink
proper fix
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Jun 30, 2023
1 parent d03098f commit 32869fd
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import type {Props} from '@theme/MDXComponents/Ul';

import styles from './styles.module.css';

function transformUlClassName(className?: string): string {
function transformUlClassName(className?: string): string | undefined {
// Fix https://github.com/facebook/docusaurus/issues/9098
if (typeof className === 'undefined') {
return undefined;
}
return clsx(
className,
// This class is set globally by GitHub/MDX. We keep the global class, and
Expand All @@ -22,5 +26,5 @@ function transformUlClassName(className?: string): string {
}

export default function MDXUl(props: Props): JSX.Element {
return <ul {...props} className={props.className ? transformUlClassName(props.className) : undefined} />;
return <ul {...props} className={transformUlClassName(props.className)} />;
}

0 comments on commit 32869fd

Please sign in to comment.