Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

289
Views
How to convert HTML entities in a string to readable text in React Native?

I am getting the following string from an API which contains some html entities. I want them to be converted to readable text. How do I do it? Is there any in-built method in React Native to do the same? Doing it without any external library would be a plus.

"This era of design where there was still some &quot;whimsy&quot; is some of my favorite Apple work too. The austere modern era where <i>everything</i> is a slab of glass fronted metal has lost so much of the joy that was found in their earlier computers.<p>If you want a touch screen computer that used this design optimized for sketching, Microsoft took it to the logical conclusion with the Surface Studio:<p><a href=\"https:&#x2F;&#x2F;www.microsoft.com&#x2F;en-us&#x2F;d&#x2F;surface-studio-2&#x2F;8sbjxm0m58t4?activetab=pivot:overviewtab\" rel=\"nofollow\">https:&#x2F;&#x2F;www.microsoft.com&#x2F;en-us&#x2F;d&#x2F;surface-studio-2&#x2F;8sbjxm0m5...</a><p>This is  much better for sketching, as can reach a much flatter angle than the G4 iMac ever could. It also holds its angle quite a bit more securely (I&#x27;ve used both). While I&#x27;m not a massive Windows user, the physical aspects of the Surface Studio are pretty nice and much more interesting to me than the latest iMacs."
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use react-native-render-html to render html content.

import React from 'react';
import { useWindowDimensions } from 'react-native';
import RenderHtml from 'react-native-render-html';

const source = {
  html: `
"This era of design where there was still some &quot;whimsy&quot; is some of my favorite Apple work too. The austere modern era where <i>everything</i> is a slab of glass fronted metal has lost so much of the joy that was found in their earlier computers.<p>If you want a touch screen computer that used this design optimized for sketching, Microsoft took it to the logical conclusion with the Surface Studio:<p><a href=\"https:&#x2F;&#x2F;www.microsoft.com&#x2F;en-us&#x2F;d&#x2F;surface-studio-2&#x2F;8sbjxm0m58t4?activetab=pivot:overviewtab\" rel=\"nofollow\">https:&#x2F;&#x2F;www.microsoft.com&#x2F;en-us&#x2F;d&#x2F;surface-studio-2&#x2F;8sbjxm0m5...</a><p>This is  much better for sketching, as can reach a much flatter angle than the G4 iMac ever could. It also holds its angle quite a bit more securely (I&#x27;ve used both). While I&#x27;m not a massive Windows user, the physical aspects of the Surface Studio are pretty nice and much more interesting to me than the latest iMacs."`
};

export default function App() {
  const { width } = useWindowDimensions();
  return (
    <RenderHtml source={source} contentWidth={width}/>
  );
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!