React Native dataDetectorType Text Prop Example Android Only

The dataDetectorType prop used with Text component in react native. Job of dataDetectorType is to determine type of data converted to clickable URL’s. In easy language when we add a hyperlink in our react native application using Linking component then by using dataDetectorType we can tell the application which type of data we are converting on click a URL. So in this tutorial we would learn about React Native dataDetectorType Text Prop Example Android.

Contents in this project React Native dataDetectorType Text Prop Example Android Only :

1. Open your project’s main App.js file and import View, StyleSheet, Text and Linking component.

2. Creating a Text component with Linking.openURL() and dataDetectorType=’link’ prop.

Supported values by dataDetectorType :-

  1. phoneNumber
  2. link
  3. email
  4. none
  5. all

3. Creating Style.

4. Complete Source Code for App.js File :-

Screenshot :-

React Native dataDetectorType Text Prop Example Android Only

Leave a Reply

Your email address will not be published. Required fields are marked *