globocom / globocom/react-native-draftjs-render

support backgroundColor in custom styles

未关闭
#61 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
390
派生
61
PR 合并指标
30 天内没有已合并 PR

描述

Hey,
I was wondering if it's possible to support the style prop `backgroundColor` for text blocks ?

Let's say I have those blocks:
```
0: {
data: {},
depth: 0,
entityRanges: [],
inlineStyleRanges: [],
key: "6dml9",
text: "Test",
type: "unstyled",
},
1: {
data: {},
depth: 0,
entityRanges: [{…}],
inlineStyleRanges: [],
key: "5dpc1",
text: "@Coco Jumbo",
type: "mention",
}
```

and this style:
```
mention: {
lineHeight: 26,
fontSize: 14,
fontWeight: 'normal',
backgroundColor: theme.color.blue.shade100,
}
```

I'd expect the `Text` component corresponding to the second block with the `mention` style to have the background color I gave it, and looking pretty much like that:
![Screenshot 2020-01-28 at 17 46 06](https://user-images.githubusercontent.com/10670669/73285294-177c3e00-41f6-11ea-861a-a6d88db22882.png)

Do you think that would be possible ? I know the `backgroundColor` style prop works fine with `Text` components in react-native, but if you didn't handle it maybe there's a reason, I'm just curious to know if you could manage to support it or not.

Or maybe I am doing something wrong ?

Anyway, great work with this package ;)

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。