【问题标题】:how can i retrieve an url from firebase and show it as clickable link in react native?如何从 firebase 检索 url 并将其显示为 react native 中的可点击链接?
【发布时间】:2021-12-01 06:18:37
【问题描述】:

<Text> {website link}</Text> 它显示为文本,现在我希望它是可点击的链接,那么如何使用 OpenURL 并在其参数中发送 firestore 字段?

【问题讨论】:

    标签: firebase react-native google-cloud-firestore hyperlink


    【解决方案1】:
    import { Linking } from 'react-native';
    
    // define websiteLink variable somewhere 
    
    ....
    
    <Text 
          onPress={() => Linking.openURL(websiteLink)}>
      {websiteLink}
    </Text>
    

    【讨论】:

      猜你喜欢
      • 2023-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-24
      • 1970-01-01
      • 2018-08-06
      • 2021-03-02
      相关资源
      最近更新 更多