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.