Open mayrsascha opened 1 year ago
I tried the same code but ended up with the same error you had.
I think the actual problem is inside ChakraUI
you probably also need to override the theme for li
element
Here how i slove this problem
import Markdown from "react-markdown";
import ChakraUIRenderer from 'chakra-ui-markdown-renderer';
import { Flex, Text, UnorderedList } from "@chakra-ui/react";
export default function MarkDownContent (
{ children } : { children: string | null | undefined }
)
{
return <>
<Flex p={4} flexDir={'column'}>
<Markdown
components={ChakraUIRenderer({
li: props=> {
const { children } = props
return <Text display={'list-item'}>{children}</Text>
},
ul: props => {
const { children } = props
return <UnorderedList my={2} mb={4} pl={2}>
{children}
</UnorderedList>
}
})}
>
{children}
</Markdown>
</Flex>
</>
}
I have the following example markdown:
My code:
results in this rendering error: