From dec62ffc3effdccf8c5a1eb99f46ca905b37b609 Mon Sep 17 00:00:00 2001 From: Liron Yahdav Date: Mon, 10 Jul 2017 11:28:10 -0700 Subject: [PATCH] Clarify JavaScript module naming edge case Summary: I've been burned by https://stackoverflow.com/questions/35052565/undefined-is-not-an-object-from-native-module-in-react-native/36580178 a few times, when I name a native module with RCT prefix. This will hopefully save me and others from that pain in the future. Closes https://github.com/facebook/react-native/pull/14903 Differential Revision: D5390343 Pulled By: hramos fbshipit-source-id: 73667d703b097e70e15ff42c54b7ccc6b480104f --- docs/NativeModulesIOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/NativeModulesIOS.md b/docs/NativeModulesIOS.md index 97451918b..0c8c11c0f 100644 --- a/docs/NativeModulesIOS.md +++ b/docs/NativeModulesIOS.md @@ -29,7 +29,7 @@ A native module is just an Objective-C class that implements the `RCTBridgeModul @end ``` -In addition to implementing the `RCTBridgeModule` protocol, your class must also include the `RCT_EXPORT_MODULE()` macro. This takes an optional argument that specifies the name that the module will be accessible as in your JavaScript code (more on this later). If you do not specify a name, the JavaScript module name will match the Objective-C class name. +In addition to implementing the `RCTBridgeModule` protocol, your class must also include the `RCT_EXPORT_MODULE()` macro. This takes an optional argument that specifies the name that the module will be accessible as in your JavaScript code (more on this later). If you do not specify a name, the JavaScript module name will match the Objective-C class name. If the Objective-C class name begins with RCT, the JavaScript module name will exclude the RCT prefix. ```objectivec // CalendarManager.m