Render HTML in React Native

0 votes

I'm importing raw HTML elements from JSON data into my React Native app in the following way: 

<p>This is some text. Let&#8217;s figure out...</p>

In my app, I've added the data to a view as follows:

<Text>{this.props.content}</Text>

The HTML is rendered incorrectly and appears in its raw form, which is a concern. 

Is it possible to make my app view's JSON data resemble how it would appear in a browser?

Aug 5 in HTML by Tejashwini
• 1,660 points
14 views

1 answer to this question.

0 votes

This is not now feasible, in my opinion. Since the Text component only outputs, well, text, the behavior you're seeing is to be expected. The WebView is the additional component you require that outputs HTML.

Sadly, there is currently no method to simply set the HTML on this component:

https://github.com/facebook/react-native/issues/506

But I just made this PR that implements a very rudimentary version of this feature, so hopefully, it will appear soon.

answered 6 days ago by Vikas

Related Questions In HTML

0 votes
0 answers

How to play video in react.js using html video tag?

Can somebody explain why my video won't ...READ MORE

Jul 19 in HTML by Tejashwini
• 1,660 points
74 views
0 votes
0 answers

Color names allowed in HTML/CSS

what are the CSS color names, though ...READ MORE

May 27 in HTML by Tejashwini
• 1,660 points
16 views
0 votes
0 answers

What is class in HTML?

what is a class in HTML, I ...READ MORE

Jun 3 in HTML by Tejashwini
• 1,660 points
20 views
0 votes
0 answers

Difference between id and name attributes in HTML

The "id" and "name" attributes serve the ...READ MORE

Jun 3 in HTML by Tejashwini
• 1,660 points
27 views
0 votes
0 answers

error: package com.android.annotations does not exist

This is my class: import com.android.annotations.NonNullByDefault; @NonNullByDefault public final class ...READ MORE

May 13 in Others by Kichu
• 19,040 points
307 views
0 votes
1 answer

Compress image up to maximum size(100kb) at NodeJS or React Native

You can follow this link : https://www.npmjs.com/package/image-conversion  This will ...READ MORE

answered May 27 in Node-js by Neha
• 8,740 points
529 views
0 votes
1 answer

Uses for the '&quot;' entity in HTML

It is impossible and unnecessary to know ...READ MORE

answered Aug 4 in HTML by Deepak
• 760 points
12 views
0 votes
1 answer

How to word wrap text in HTML?

Try this: div { width: ...READ MORE

answered Aug 4 in HTML by Deepak
• 760 points
10 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP