How to do it...

  1. Let's start by opening the Android project in Android Studio. In the Android Studio welcome screen, select Open an existing Android Studio project and open the android directory of the project.
  1. Open the project explorer and expand the package structure until you can see the Java source files (for example, app/java/com.nativeuicomponent):
  1. Right-click on the package and select New | Java Class. Use ButtonViewManager for the class name and set the Kind field to Class.
  2. Use the same method to also create a ButtonPackage class.
  3.  Let's begin implementing our ButtonViewManager class, which must be a subclass of SimpleViewManager<View> ...

Get React Native Cookbook - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.