先来看下官网对于Native Modules的描述:
Sometimes an app needs access to a platform API that React Native doesn’t have a corresponding module for yet. Maybe you want to reuse some existing Java code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.
We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don’t expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn’t support a native feature that you need, you should be able to build it yourself.
上面大概的意思是说,我们有时后需要用的API,RN并没有提供。而且我们可能会想用一些现成的java代码,或者写一些高质量、多线程的代码等等。
官网上提供了4种:
- Toast Module
- Callbacks
- Threading
- Send