Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ function extractMDXAdmonitionTitle(children: ReactNode): {
React.isValidElement(item) &&
(item.props as {mdxType: string} | null)?.mdxType ===
'mdxAdmonitionTitle',
);
) as JSX.Element | undefined;
const rest = <>{items.filter((item) => item !== mdxAdmonitionTitle)}</>;
return {
mdxAdmonitionTitle,
mdxAdmonitionTitle: mdxAdmonitionTitle?.props.children,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey

Actually the template trick seems un-necessary: you just found the issue here

See prod markup:

https://docusaurus.io/tests/pages/markdownPageTests#admonitions

CleanShot 2022-10-26 at 17 58 28@2x

The utils code does not unwrap the element and still let it pass through up to the React reconcilier (which emits the warning)

Just adding this line fixes the issue

Copy link
Collaborator Author

@Josh-Cena Josh-Cena Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, great find! Let me try

rest,
};
}
Expand Down