Please check the image-
how can I do that in my react native app
import React, { useContext, useState } from 'react';
import { View, Button, Text, StyleSheet, Switch} from 'react-native';
const Testing = ({ navigation }) => {
return (
<View>
<Text> My mother has blue eyes and my father has dark green eyes.</Text>
</View>
);
}
export default Testing;
2
Answers
Text elements have to be nested:
Example: https://reactnative.dev/docs/text#nested-text
You can add a
<Text>
inside another<Text>
and add a style for each text. Like the code bellow:Perceive my inner
<Text>
has a style different from the outter<Text>
, and also perceive my inner<Text>
has even aonPress
, which will be applied only to this inner<Text>
when pressed (it’s a link inside the body of a text).