Explaining JS and Native modules
React Native does not cover all the native capabilities out of the box. It only provides the most common features that you will need in a basic application. Also, the Meta team itself has recently moved some functions into its own modules in an effort to reduce the size of the overall application. For example, AsyncStorage
, for storing data on a device, was moved into a separate package and must be installed if you plan to use it.
However, React Native is an extendable framework. We can add our own native modules and expose the JS API using the same bridge or JSI. Our focus in this book will not be on developing native modules, since we need prior experience with Objective-C or Java. Also, it is not necessary, since the React community has created an enormous number of ready-to-use modules for all cases. We will learn how to install native packages in subsequent chapters.
The following are a few of the most popular native modules, without which...