I am trying to format links which are present in text input, something like how stack overflow does. On click the link should open in the browser.
Does one have any idea how this can be done in React Native?
I am trying to format links which are present in text input, something like how stack overflow does. On click the link should open in the browser.
Does one have any idea how this can be done in React Native?
Found something similar to what I was looking, doesn't change the styling of the text but makes the links in the click able.
import React, { Component } from 'react';
import { View, StyleSheet, Button, Linking } from 'react-native';
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<Button title="Click me" onPress={ ()=>{ Linking.openURL('https://google.com')}} />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#ecf0f1',
},
});