问题描述
在我目前正在开发的应用程序中,有一个“描述”列,我想要它具有富文本。这将以 Markdown 格式存储在我的数据库中。无论如何,当使用 react-table 让单元格包含另一个组件中的内容时,在这种情况下,内容可以通过 react-markdown 呈现吗?
在实现 react-table 之前,我能够使用 <td><ReactMarkdown>{item.description}</ReactMarkdown></td>
解析描述单元格中的降价,但我没有看到使用 react-table 实现这一点的方法。
这是有问题的代码:https://github.com/TechValleyCenterOfGravity/STUFF/blob/main/src/App.js
解决方法
我错过了一个大写的 C - Cell: props => <ReactMarkdown>{ props.value }</ReactMarkdown>
成功了