Navigate back to the homepage

How to use br tag in react native

Infinitbility
React Native
August 6th, 2021 · 1 min read
How to use br tag in react native

Hello Friends 👋,

Welcome To Infinitbility! ❤️

This article helps you how to break line of text in react native, for HTML we know <br> tag will do that but in react native. <br> tag not available then today we will see how we can break line in react native.

Let start today topic how to use br tag in react native

Well, React Native is not supported the <br> tag but we have another option and is \n new line 😄.

We have to just put {"\n"} this code on the text where we want to new line like below.

1<Text> Hi, {"\n"} Infinitbility</Text>

Let’s understand with react native code example.

Below example, I have explained in both ways

Add new line using react native code Use \n in a text string

br tag example in react native using \n new line

1import React, { Component } from 'react';
2import { View, Text } from 'react-native';
3
4class ClassComponent extends Component {
5
6 constructor(props) {
7 super(props);
8
9 this.state = {
10 message : 'Hi,\nCurtis! Here',
11 }
12
13 }
14
15 render() {
16 const { names } = this.state;
17 return (
18 <View>
19 <Text>Hi {"\n"} {this.state.message}</Text>
20 </View>
21 );
22 }
23}
24
25export default ClassComponent;

Thanks For Reading…

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Tutorials

React Native

Categories

More articles from Infinitbility

How to use array in react native

How to use array in react native

React Native array example

August 5th, 2021 · 1 min read
How to use async await in react native

How to use async await in react native

React Native async await example

August 5th, 2021 · 1 min read
© 2020–2021 Infinitbility
About
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]