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

Using font icons

When dealing with images, we need to think about supporting different screen densities and resolutions. For that, we will have to create different versions of the same image and will need to change the size and the name so that React Native uses the correct image for the given resolution. While this works fine, we will have to spend time maintaining all the images. In addition, the size of our app will increase because we need to bundle all those images.

We already have solved that problem on the Web by using fonts or SVGs, and it's a pretty good solution. In this recipe, we will use fonts to render icons and solve the problem of screen density.

For this recipe, we will use a third-party library to help us render the icons. 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