Skip to content

Commit

Permalink
Fix TS typing of style props
Browse files Browse the repository at this point in the history
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/
  • Loading branch information
richeterre authored Mar 15, 2019
1 parent 9bc9da5 commit 9789a10
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -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<TextStyle>;
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<TextStyle>;
linkStyle?: StyleProp<TextStyle>;
linkDefs?: ILinkDef[];
onLinkPress?: (text: string) => void;
}
Expand Down

0 comments on commit 9789a10

Please sign in to comment.