Skip to content

How to extend the default list? #33

@mayrsascha

Description

@mayrsascha

I have the following example markdown:

  • Test A

My code:

import ReactMarkdown from 'react-markdown'
import ChakraUIRenderer from 'chakra-ui-markdown-renderer'
import { List } from "@chakra-ui/react"
...

<ReactMarkdown
  components={ChakraUIRenderer({
     ...,
     ul: ({ children }) => {
        return <List as="ul">
          {children}
        </List>
      }
  })} 
>
   {markdown}
</ReactMarkdown>

results in this rendering error:

ContextError: useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions