From 4cc6e7a3f6e6571a31b5d64b68541aa8b3a07447 Mon Sep 17 00:00:00 2001 From: Awa Desmoline Date: Sat, 28 Nov 2020 21:32:17 +0100 Subject: [PATCH] Style highlighted text --- Demo/SelectableText.js | 4 ++-- index.d.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Demo/SelectableText.js b/Demo/SelectableText.js index bd6d5d8..54c732c 100644 --- a/Demo/SelectableText.js +++ b/Demo/SelectableText.js @@ -112,9 +112,9 @@ export const SelectableText = ({ selectable style={ isHighlight - ? { + ? [{ backgroundColor: props.highlightColor, - } + }, props.highlightedTextStyle] : {} } onPress={() => { diff --git a/index.d.ts b/index.d.ts index 97b2e90..bc4f4d0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -14,6 +14,7 @@ export interface SelectableTextProps { highlights?: Array<{ id: string; start: number; end: number }>; highlightColor?: string; style?: StyleProp; + highlightedTextStyle?: StyleProp; onHighlightPress?: (id: string) => void; appendToChildren?: ReactNode; TextComponent?: ReactNode;