O'Reilly logo

React Native Cookbook by Crysfel Villa, Stan Bershadskiy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rendering simple HTML elements using native components

We have learned how to use a WebView to render a third-party website; however, sometimes we only need to render text with HTML tags on it.

In this recipe, we will render text in the HTML format using native components. To achieve this, we will use a third-party library called react-native-htmlview by James Friend.

Getting ready

In order to follow the steps in this recipe, we need to create an empty app using the React Native CLI. We will name our new app RenderHtml. Feel free to use any other name, just make sure to use the correct name in step 2.

How to do it...

  1. The first thing we need to do is install the library using npm. Open the terminal and go to the root of the project, and then run the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required