GetStream活动组件无法正确呈现新行

时间:2019-06-12 19:19:53

标签: reactjs getstream-io

流活动组件 https://getstream.github.io/react-activity-feed/#activity无法呈现新行。

 {
  "actor": {
  },
  "attachments": {
    "files": [],
    "images": []
  },
  "foreign_id": "",
  "id": "",
  "latest_reactions": {},
  "latest_reactions_extra": {},
  "object": "Post\npost\npost\npost",
  "origin": null,
  "own_reactions": {},
  "reaction_counts": {},
  "target": "",
  "text": "Post\npost\npost\npost",
  "time": "2019-06-12T19:11:46.728935",
  "verb": "post"
}

在以上数据中,文本包含新行“ Post \ npost \ npost \ npost”,但仍在单行中,如下图所示。

Single line text

该组件中是否可以进行任何处理。

1 个答案:

答案 0 :(得分:1)

您可以通过设置以下CSS来解决此问题:

.raf-activity__content p {
    white-space: pre-line
}

我还将它包含在0.9.16的最新版本(react-activity-feed)中,因此您不必自己做。