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 custom iOS view components

While it is very important to leverage the devices processing power in executing code on the native layer in our React Native application, it is equally important to leverage its rendering power to show native UI components. React Native can render any UI component that is an implementation of UIView inside an application. These components can be lists, form fields, tables, graphics, and so on.

For this recipe, we created a React Native application titled NativeUIComponent.

In this recipe, we will take a native UIButton and expose it as a React Native view component. You will be able to set the button label and attach a handler for when it is tapped.

How to do it...

  1. Open the iOS Project in Xcode. The project file ...

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