Skip to content

Possible to use MaterialUI Table with the renderer prop? #617

Discussion options

You must be logged in to vote

it is and it is documented how in the readme

renderers (Object.<Component>, default: {})
Object mapping node types to React components

https://github.com/remarkjs/react-markdown#props

the node types that can be mapped are documented here: https://github.com/remarkjs/react-markdown#appendix-b-node-types
and include:

  • table — Table (<table>)
  • tableHead — Table head (<thead>)
  • tableBody — Table body (<tbody>)
  • tableRow — Table row (<tr>)
  • tableCell — Table cell (<td> or <th>)

match the renderer prop name with the node name you want, and the custom render function will work.

in your example table works because it matches the node type you want to map.
thead should be tableHead to work, tbody

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ahmetskilinc
Comment options

Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants