From 9789a10da8168d83473f788113b6716f4ae98060 Mon Sep 17 00:00:00 2001 From: Martin Richter Date: Fri, 15 Mar 2019 09:33:28 +0100 Subject: [PATCH] Fix TS typing of style props This change allows us to pass multiple styles to the component, as explained e.g. here: https://spin.atomicobject.com/2018/06/02/custom-components-react-native/ --- index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.d.ts b/index.d.ts index 966aacf..c683242 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,18 +1,18 @@ declare module "react-native-hyperlinked-text" { - import {TextStyle} from "react-native"; + import {StyleProp, TextStyle} from "react-native"; export interface ILinkDef { regex: RegExp; - style?: TextStyle; + style?: StyleProp; replaceText?: (orig: string, text: string, url: string) => string; onPress?: (orig: string, text: string, url: string) => void; noPress?: boolean; } interface IProps { - style?: TextStyle; - linkStyle?: TextStyle; + style?: StyleProp; + linkStyle?: StyleProp; linkDefs?: ILinkDef[]; onLinkPress?: (text: string) => void; }