mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
1cb0a3342a
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43068 This diff adds `react-native-test-library` package. It contains native module and native component example, and targets both the new and the old architecture. It has structure similar to many OSS React Native libraries, and is supposed to be used to test the integration with third-party libraries. It is integrated with RNTester as the **OSS Library Example** screen. {F1457510909} **Change Background** tests native commands. **Set Opacity** tests native props. **Get Random Number** tests native module. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D50793835 fbshipit-source-id: ff6daefab10e6e9f13049e3013f8f63cfa8a929e
30 lines
1.2 KiB
Plaintext
30 lines
1.2 KiB
Plaintext
/**
|
|
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
*
|
|
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
* once the code is regenerated.
|
|
*
|
|
* @generated by codegen project: GenerateModuleObjCpp
|
|
*
|
|
* We create an umbrella header (and corresponding implementation) here since
|
|
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
* must have a single output. More files => more genrule()s => slower builds.
|
|
*/
|
|
|
|
#import "OSSLibraryExampleSpec.h"
|
|
|
|
|
|
namespace facebook::react {
|
|
|
|
static facebook::jsi::Value __hostFunction_NativeSampleModuleSpecJSI_getRandomNumber(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, NumberKind, "getRandomNumber", @selector(getRandomNumber), args, count);
|
|
}
|
|
|
|
NativeSampleModuleSpecJSI::NativeSampleModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms)
|
|
: ObjCTurboModule(params) {
|
|
|
|
methodMap_["getRandomNumber"] = MethodMetadata {0, __hostFunction_NativeSampleModuleSpecJSI_getRandomNumber};
|
|
|
|
}
|
|
} // namespace facebook::react
|