How Can I Insert A Line Break Into A Text Component In React Native

85780/how-can-insert-line-break-into-text-component-in-react-native

  • Home
  • Community
  • Categories
  • Web Development
  • Java-Script
  • How can I insert a line break into a Text ...
How can I insert a line break into a Text component in React Native 0 votes

I want to insert a new line (like \r\n, <br />) in a Text component in React Native.

If I have:

<text><br /> Hi~<br > this is a test message.<br /> </text>

Then React Native renders Hi~ this is a test message.

Is it possible render text to add a new line like so:

Hi~ this is a test message.
  • html
  • css
  • javascript
  • laravel
  • php
  • angularjs
Sep 21, 2020 in Java-Script by kartik 37,520 points 16,602 views answer comment
  • flag

Your comment on this question:

Your name to display (optional):
Email me at this address if a comment is added after mine:
Privacy: Your email address will only be used for sending these notifications.
Add comment Cancel

1 answer to this question.

Your answer

Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Privacy: Your email address will only be used for sending these notifications.
Add answer Cancel
0 votes

Hello @kartik,

This should do it:

<Text> Hi~{"\n"} this is a test message. </Text>

Hope it helps!!

If you need to know more about React, Its recommended to join React JS Course today.

Thank you!

answered Sep 21, 2020 by Niroj 82,800 points comment
  • flag
  • ask related question

Your comment on this answer:

Your name to display (optional):
Email me at this address if a comment is added after mine:
Privacy: Your email address will only be used for sending these notifications.
Add comment Cancel

Related Questions In Java-Script

0 votes 1 answer

How can I specify a local gem in my Gemfile?

Hello @kartik, In order to use local gem ...READ MORE

answered Jul 24, 2020 in Java-Script by Niroj 82,800 points 4,469 views
  • html
  • css
  • javascript
  • laravel
  • php
  • ruby-on-rails
0 votes 1 answer

How can i insert data in relation table using model?

Hello @Alisha, Try to work using the model ...READ MORE

answered Aug 24, 2020 in Java-Script by Niroj 82,800 points 2,817 views
  • javascript
  • web
  • development
0 votes 0 answers

How can I create a two dimensional array in JavaScript?

Is it possible to create a two-dimensional ...READ MORE

May 9, 2022 in Java-Script by Kichu 19,040 points 1,254 views
  • javascript
  • arrays
  • multidimensional-array
0 votes 1 answer

How can I replace every instance of a string in JavaScript?

In JavaScript, replacing all instances of a ...READ MORE

answered Jan 10, 2025 in Java-Script by Navya 641 views
  • js
  • web
  • development
  • react
+1 vote 1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj 82,800 points 25,407 views
  • html
  • css
  • javascript
  • laravel
  • angularjs
  • php
0 votes 1 answer

What is type casting and type juggling in php?

Hey, The way by which PHP can assign ...READ MORE

answered Mar 27, 2020 in PHP by Niroj 82,800 points 8,031 views
  • html
  • css
  • javascript
  • php
  • angularjs
  • laravel
0 votes 2 answers

How can we create a session in PHP?

Hello, niroj. Here is my idea session_start(); $_SESSION['USERNAME'] ...READ MORE

answered Dec 7, 2020 in PHP by Famous 140 points 2,280 views
  • html
  • css
  • javascript
  • php
  • angularjs
  • laravel
0 votes 1 answer

What is the use of $_REQUEST variable in php?

Hii @kartik, The $_REQUEST variable is used to read the ...READ MORE

answered Mar 27, 2020 in PHP by Niroj 82,800 points 5,150 views
  • html
  • css
  • javascript
  • php
  • angularjs
  • laravel
0 votes 1 answer

How do I break a string across more than one line of code in JavaScript?

Hello @kartik, In your example, you can break ...READ MORE

answered Oct 8, 2020 in Java-Script by Niroj 82,800 points 1,287 views
  • html
  • laravel
  • javascript
  • css
  • php
0 votes 1 answer

How can I rename a database column in a Ruby on Rails migration?

Hello @kartik, Try using this: rename_column :table, :old_column, :new_column You'll ...READ MORE

answered Jul 24, 2020 in Java-Script by Niroj 82,800 points 2,252 views
  • html
  • css
  • javascript
  • laravel
  • php
  • nodejs

Recent in Java-Script

  • How to create an attribute directive that changes element behavior on hover events? Apr 10, 2025
  • How to customize the default theme in jQuery Mobile CSS Framework? Apr 7, 2025
  • How to handle form submissions asynchronously in jQuery Mobile applications? Apr 7, 2025
  • How to create closable tabs in jQuery UI Tabs? Apr 7, 2025
  • How to handle multiple accordions on a single page with jQuery UI? Apr 7, 2025
  • All categories
  • Generative AI Generative AI (1,454)
  • Power BI Power BI (1,316)
  • DevOps & Agile DevOps & Agile (4,138)
  • Data Science Data Science (100)
  • ChatGPT ChatGPT (30)
  • Cyber Security & Ethical Hacking Cyber Security & Ethical Hacking (1,057)
  • Data Analytics Data Analytics (1,266)
  • Cloud Computing Cloud Computing (4,053)
  • Machine Learning Machine Learning (337)
  • PMP PMP (1,069)
  • Python Python (3,488)
  • SalesForce SalesForce (201)
  • Selenium Selenium (1,624)
  • Software Testing Software Testing (58)
  • Tableau Tableau (608)
  • Web Development Web Development (3,972)
  • UI UX Design UI UX Design (24)
  • Java Java (1,358)
  • Azure Azure (157)
  • Database Database (858)
  • Big Data Hadoop Big Data Hadoop (1,907)
  • Blockchain Blockchain (1,673)
  • Digital Marketing Digital Marketing (121)
  • C# C# (141)
  • C++ C++ (272)
  • IoT (Internet of Things) IoT (Internet of Things) (390)
  • Kotlin Kotlin (8)
  • Linux Administration Linux Administration (389)
  • MicroStrategy MicroStrategy (7)
  • Mobile Development Mobile Development (395)
  • Others Others (2,386)
  • RPA RPA (653)
  • Talend Talend (73)
  • TypeSript TypeSript (124)
  • Apache Kafka Apache Kafka (84)
  • Apache Spark Apache Spark (596)
  • Career Counselling Career Counselling (1,091)
  • Events & Trending Topics Events & Trending Topics (28)
  • Ask us Anything! Ask us Anything! (71)

Join the world's most active Tech Community!

Welcome back to the World's most active Tech Community!

Sign up with Gmail Sign up with Facebook

OR

Password must have

At least 1 upper-case and 1 lower-case letter

Minimum 8 characters and Maximum 50 characters

SIGN UP Already have an Edureka Account? Login Forgot Password? LOGIN Don’t have edureka account? Sign Up resend ? Password must have

At least 1 upper-case and 1 lower-case letter

Minimum 8 characters and Maximum 50 characters

reset password Don’t have edureka account? Sign Up reset password Don’t have edureka account? Sign Up Send Code Don’t have edureka account? Sign Up

Subscribe to our Newsletter, and get personalized recommendations.

Google Sign up with Google facebook Signup with Facebook

Already have an account? Sign in.

webinar REGISTER FOR FREE WEBINAR X Years of Experience* Student 0-2 Years 2-5 Years 5-10 Years 10+ Years REGISTER NOW webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP "PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.

Tag » How To Line Break In React