diff --git a/.changeset/poor-eyes-jump.md b/.changeset/poor-eyes-jump.md new file mode 100644 index 0000000000..248fabba29 --- /dev/null +++ b/.changeset/poor-eyes-jump.md @@ -0,0 +1,5 @@ +--- +"@assistant-ui/react-markdown": patch +--- + +fix: react warning about unsupported prop diff --git a/packages/react-markdown/src/overrides/CodeOverride.tsx b/packages/react-markdown/src/overrides/CodeOverride.tsx index 7cf5a6bb79..1508a58f28 100644 --- a/packages/react-markdown/src/overrides/CodeOverride.tsx +++ b/packages/react-markdown/src/overrides/CodeOverride.tsx @@ -76,20 +76,29 @@ export type CodeOverrideProps = ComponentPropsWithoutRef & { CodeHeader: ComponentType; SyntaxHighlighter: ComponentType; }; - componentsByLanguage?: Record< - string, - { - CodeHeader?: ComponentType; - SyntaxHighlighter?: ComponentType; - } - >; + componentsByLanguage?: + | Record< + string, + { + CodeHeader?: ComponentType; + SyntaxHighlighter?: ComponentType; + } + > + | undefined; }; export const CodeOverride: FC = ({ components, + componentsByLanguage, ...props }) => { const preProps = useContext(PreContext); if (!preProps) return ; - return ; + return ( + + ); };