Summary:
The current docs (iOS) for promises make use of the `RCT_REMAP_METHOD` macro but it's not clear about the proper usage for the macro. Specifically, it points to a selector of `resolver:rejector:` and makes it seem like `findEvents` is assumed as both the alias and method name.
This has led to some confusion (#9070) on how to use `RCT_REMAP_METHOD`.
No tests needed since this is just a small docs update.
Closes https://github.com/facebook/react-native/pull/13302
Differential Revision: D4831755
Pulled By: javache
fbshipit-source-id: e842c16ade27088eafdac7509373cdf7780f9ece
Summary:
Doing some cleanup in preparation for CRNA.
Recommend `FlatList` and React Navigation for perf.
Tag docs that may only apply to apps ejected from CRNA. Currently has no effect.
Closes https://github.com/facebook/react-native/pull/12692
Differential Revision: D4654077
Pulled By: hramos
fbshipit-source-id: 1245d80d66e37d9dca9e9daf23e8b93c65cd1bf7
Summary:
I think this update is Critical as I wanted to add a different module name to be the same as the Android module name. I simply lost 6 hours until I found out that the Macro does not accept String syntax. Almost drove me crazy. Please, at least do something about it. Thanks.
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**
Explain the **motivation** for making this change. What existing problem does the pull request solve?
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
**Test plan (required)**
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI
Closes https://github.com/facebook/react-native/pull/11634
Differential Revision: D4533312
Pulled By: lacker
fbshipit-source-id: 2c547f791ed76ba62e0c7e5cabc2830dbae34075
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?
Descriptions about class names are incorrect.
Closes https://github.com/facebook/react-native/pull/11898
Differential Revision: D4418957
fbshipit-source-id: fc7d0b61149ed9f850a436a35ad98f179b5e3e19
Summary:
Sending global events with `eventDispatcher` has been [deprecated](d9737571c4) since 0.28, with a recommendation to subclass `RCTEventEmitter` instead, but there were no docs for this.
This updates the iOS native module to use the recommended way, and also documents the use of `stopObserving` and `startObserving`.
Tested and working in a real app.
cc nicklockwood
Closes https://github.com/facebook/react-native/pull/11792
Differential Revision: D4394626
fbshipit-source-id: 68b26d35944a521bf683a50ec1ab21f03b5e99d8
Summary:
As of Swift 3, [Swift converts Objective-C API names based on parameters](https://github.com/apple/swift-evolution/blob/master/proposals/0005-objective-c-name-translation.md), so the docs should explicitly declare what the Objective-C API is (because it's also used in the JavaScript side too).
An alternative to this would be to update the Objective-C and JavaScript calls to be `addEventWithName:location:date:` / `addEventWithName()` based on the default Swift API, but I think the approach in the PR is most correct here.
Closes https://github.com/facebook/react-native/pull/10176
Differential Revision: D4001604
Pulled By: hramos
fbshipit-source-id: cd4143d19d2d375288a086b9d7995e75fe1e9170
Summary:
Explicitly show import statements in example implementation file. Xcode build fails unless RCTLog is imported. Adding this clarifies this, as it is not stated anywhere else.
Closes https://github.com/facebook/react-native/pull/10117
Differential Revision: D3952631
Pulled By: javache
fbshipit-source-id: f268ff53ee2cf69aabd83c3305c5c25add338d83
Summary:
Added details about how IOS Native Modules can be initialized & registered manually with custom initializers so that dependencies can be injected to said modules.
Please let me know if there is a more appropriate place to detail this in the documentation or this is in fact detailed elsewhere; I also believe we do not have documentation on how to do the equivalent on Android, however it is a bit more obvious as the automatic MACRO registration mechanism does not exist on Android and modules need to be initialized manually anyway. As I currently understand there isn't currently any documentation detailing this apart from comments in the source.
Please let me know if you would require any style changes (variable names etc), to be more en-keeping with the rest of the documentation.
Closes https://github.com/facebook/react-native/pull/8406
Differential Revision: D3843018
Pulled By: javache
fbshipit-source-id: 5f4001df32d1ddc00a9dacc4fc99b63b408f1536
Summary:
I was following the Native Modules guide for iOS, when I noticed this error in the example code:
> Argument 2 (NSNumber) of CalendarManager.addEvent has unspecified nullability but React requires that all NSNumber arguments are explicitly marked as `nonnull` to ensure compatibility with Android.
Marking the parameter NSNumber type as `nonnull` fixes the error in the example.
Closes https://github.com/facebook/react-native/pull/9705
Differential Revision: D3804661
Pulled By: JoelMarcey
fbshipit-source-id: 92ec8a08ff2a179e4a8935de4cecd7b8d993469b
Summary:
We had rendering support for prev links, but we never had any previous links in our metadata. Only next links. This adds that support to both Guides and APIs.
**For guides**: `previous` is manually inserted into the metadata of the actual markdown file.
**For APIs/Components**: `previous` is established via code within `extractDocs.js`
> This isn't totally perfect. For example, the transition from the last guide to the first API/component has a next link from the guide, but not a previous link from the API since the way you get the previous links are different from guides and APIs. But this gets us really close.
Closes https://github.com/facebook/react-native/pull/8754
Differential Revision: D3557972
Pulled By: hramos
fbshipit-source-id: e270bb51e7a4f59f61dad28ae0928d27d0af3d4a
Summary:This really stumped me and I thought it could be added to the docs.
Closes https://github.com/facebook/react-native/pull/6136
Differential Revision: D2973912
Pulled By: mkonicek
fb-gh-sync-id: 0da1a946e2c2ad00056037a6492be3e99096582e
shipit-source-id: 0da1a946e2c2ad00056037a6492be3e99096582e
Summary:There is no toTime method on a Date object, It should be getTime.
Closes https://github.com/facebook/react-native/pull/6054
Differential Revision: D2971217
fb-gh-sync-id: 4140be25f0704f251cc0e2f47db8fa83992dc0f0
shipit-source-id: 4140be25f0704f251cc0e2f47db8fa83992dc0f0
This is an early release and there are several things that are known
not to work if you're porting your iOS app to Android.
See the Known Issues guide on the website.
We will work with the community to reach platform parity with iOS.
This is in preparation for open sourcing React Native for Android.
Also add hyphens to URLs for consistency. This can break people's
browser bookmarks but it's better to be consistent and we can
redirect to docs: https://github.com/facebook/react-native/issues/2137
Test plan: Ran the website locally using `cd website; npm start`
and checked all pages render correctly.
http://i.imgur.com/RrPNgRr.png
Will update "Getting Started", "Tutorial", "Debugging" and
"Testing" separately.
It looks like in the various changes to native module events, the documentation has become a little confused. As far as I can tell, if you use `sendAppEventWithName` then the `NativeAppEventEmitter` is used and if `sendDeviceEventWithName` then it should be `DeviceEventEmitter`.
This may be common knowledge for most Swift/ObjC guys, but it took me quite a while to figure out why I was getting an error when creating/exporting my module. As a web guy coming to the "native" world, it was a bit confusing. I would imagine a lot of RCTN users will be in the same boat.