diff options
Diffstat (limited to 'src/view/com/util/Link.tsx')
-rw-r--r-- | src/view/com/util/Link.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/view/com/util/Link.tsx b/src/view/com/util/Link.tsx index d4df2bec4..1a6f047f6 100644 --- a/src/view/com/util/Link.tsx +++ b/src/view/com/util/Link.tsx @@ -59,6 +59,7 @@ export const Link = observer(function Link({ }: Props) { const store = useStores() const navigation = useNavigation<NavigationProp>() + const anchorHref = asAnchor ? sanitizeUrl(href) : undefined const onPress = React.useCallback( (e?: Event) => { @@ -96,7 +97,7 @@ export const Link = observer(function Link({ accessibilityRole="link" {...props}> {/* @ts-ignore web only -prf */} - <View style={style} href={asAnchor ? sanitizeUrl(href) : undefined}> + <View style={style} href={anchorHref}> {children ? children : <Text>{title || 'link'}</Text>} </View> </TouchableWithoutFeedback> @@ -123,7 +124,7 @@ export const Link = observer(function Link({ accessible={accessible} accessibilityRole="link" // @ts-ignore web only -prf - href={asAnchor ? sanitizeUrl(href) : undefined} + href={anchorHref} {...props}> {children ? children : <Text>{title || 'link'}</Text>} </Com> |