Summary:
After pulling in AsyncStorage doc changes, getting typehint errors when running docs. This fixes that issue.
**Test plan (required)**
Opened http://localhost:8079/react-native/index.html
Clicked around. No errors. Also successfully ran:
```
node server/generate.js
```
Closes https://github.com/facebook/react-native/pull/8412
Differential Revision: D3482007
Pulled By: JoelMarcey
fbshipit-source-id: 7b0da2b2b38fd1f1bdec1b7c810ee70c536dd2bb
Summary:
Relates to #8203 for AsyncStorage API update.
- Added a small example to the intro section.
- Added jsdoc format tags to show up class description, parameter descriptions.
- Word-smithed many of the method descriptions.
I also made a bug fix to the autogen. It wasn't handling the scenario where a method may have no parameters.
**Test plan (required)**
Wrote a small sample app to test the snippet added to the intro section.
Ran website locally: http://localhost:8079/react-native/docs/asyncstorage.html
![api_asyncstorage](https://cloud.githubusercontent.com/assets/691109/16329457/84f9d69c-3997-11e6-9e68-3a475df90377.png)
Ran changed files through the linter.
Closes https://github.com/facebook/react-native/pull/8396
Differential Revision: D3481783
Pulled By: JoelMarcey
fbshipit-source-id: ebc4b9695482ada8a3455e621534d2a7fb11edf4
Summary:
Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android.
DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector.
For reference, [the relevant issue on react-devtools](https://github.com/facebook/react-devtools/issues/229).
Closes https://github.com/facebook/react-native/pull/8095
Reviewed By: javache
Differential Revision: D3443980
Pulled By: andreicoman11
fbshipit-source-id: 3d7b2e83cf4158a1228d2e21510509ab63411a5d
Summary:
Initial stab at writing a high level guide on navigation. Its main focus is on Navigator due to it being cross-platform and fairly simple to use.
This guide should be expanded to cover tabbed applications in a future pull request.
The Navigation (Experimental) section will be similarly expanded upon as the API stabilizes.
![navigation](https://cloud.githubusercontent.com/assets/165856/16324560/52b508dc-396a-11e6-94b7-b2d1175f69e0.png)
Closes https://github.com/facebook/react-native/pull/8390
Differential Revision: D3480304
Pulled By: caabernathy
fbshipit-source-id: 280da9185fca295bc107a2df20106c783b461be7
Summary:
GIF Image will disappear after press the home button and return back.
Set `removedOnCompletion` to be`false` will fix all `CAAnimation` disappear like stopping after going into the background.
Closes https://github.com/facebook/react-native/pull/7612
Differential Revision: D3481403
fbshipit-source-id: 101bded300f5e34bb53ec6c54a40eb5aece22fba
Summary: Create isDeviceLanguageRTL function to connect the OS language with isRTL. Now even if a new app could support RTL language, without setting forceRTL at JS side it won't directly change into RTL layout.
Reviewed By: fkgozali
Differential Revision: D3473109
fbshipit-source-id: ac1410c910e980d44750bb88cad7615febb9e076
Summary:
This is just improving a bit of lameness on the homepage - Devin pointed out the <>'s don't work within a Text tag, so I removed them, and someone else pointed out that nonexistent fake urls are suboptimal, so I improved that too.
Closes https://github.com/facebook/react-native/pull/8387
Differential Revision: D3479087
Pulled By: JoelMarcey
fbshipit-source-id: 45a2d21a9073b58b869e8b344550c28f849e0185
Summary:
Right now the embedded simulator is always at the top right corner.
This can be confusing as to what code is associated with the simulation.
So, move the simulator next to its actual code.
This has the added benefit of allowing us to use the React Native
Web Player for the simpler examples in the components.
Closes https://github.com/facebook/react-native/pull/8384
Differential Revision: D3479056
Pulled By: bestander
fbshipit-source-id: f400d8387ec771b94d5e798c1e955b25f9a0f1bf
Summary:
In the web player in the docs, allows `AppRegistry.registerComponent('name', App)` to use *anything* for `'name'`. It is ignored by the web player - last registration wins.
Closes https://github.com/facebook/react-native/pull/8383
Differential Revision: D3478922
Pulled By: JoelMarcey
fbshipit-source-id: 3d1d96e0ad41216d29134ba384896e86d0cd2b32
Summary:
It works without out the `extends`, but I do not really understand why,
unless there is some magic implicit `extends` if you don't put it and
you call `registerComponent`. But, I figure we should be explicit unless
there is a good reason not to be.
Closes https://github.com/facebook/react-native/pull/8377
Differential Revision: D3478950
Pulled By: JoelMarcey
fbshipit-source-id: 05ea4367c3c8c34aea6c092639ee51d8761bca3f
Summary:
Cleans up `InitializeJavaScriptAppEngine` in a few ways:
- Fix bug where `global.navigation.geolocation` was being assigned to `global`.
- Rename `polyfillGlobal` to `defineProperty`.
- Rename `polyfillLazyGlobal` to `defineLazyProperty`.
- Inline `polyfillIfNeeded` (only used once).
- Rename `setUpMapAndSet` to `setUpCollections`.
- Add `flow`.
I've changed `defineProperty` and `defineLazyProperty` to always accept an `object` property since it is not only used for defining properties on `global`.
Reviewed By: davidaurelio
Differential Revision: D3472147
fbshipit-source-id: 492da62a303cf040211c386fa6260789e50b43c1
Summary:
The example uses StyleSheet.create and also arrays-of-styles. I think this covers everything the old one did, but in simple-enough-for-the-basics form, so I removed the old one. I also reordered so that "Style -> Dimensions -> Layout" is the flow for learning "Styley" things.
Closes https://github.com/facebook/react-native/pull/8379
Differential Revision: D3478384
Pulled By: caabernathy
fbshipit-source-id: 158f0f0367c8eb8b2b24feda0d8d7a533fd7af4d
Summary:
Two of the known issues have been moved to the issue tracker:
* #8315
* #8316
Others have been moved into more appropriate locations, such as the `TextInput` issue to the API doc itself, and the React debugging issue to the Debugging doc.
The Android-specific compatibility concerns have been dropped entirely as it does not seem like people would find these in the docs.
Closes https://github.com/facebook/react-native/pull/8321
Differential Revision: D3477999
Pulled By: JoelMarcey
fbshipit-source-id: dfffc9910ebf5514eb14c6aa8a9a3e70761db874
Summary:
Added some documentation to the `RunningOnDeviceAndroid.md` with screenshots to set custom port
Closes https://github.com/facebook/react-native/pull/8355
Differential Revision: D3475846
Pulled By: mkonicek
fbshipit-source-id: 73675b19e2bb93c859bda239f228da0883f0e305
Summary:
in `runAndroid.js` I renamed the `buildAndRun()` into `run()` and added a call to `runAdbReverse`
Closes https://github.com/facebook/react-native/pull/8345
Differential Revision: D3475782
Pulled By: mkonicek
fbshipit-source-id: 6f2c5a3e6d61cbeec914175686d2a7909d22a957
Summary:
Changed const to let, to dodge the following issue:
> "errorMessage" is read-only
> 203 | const errorMessage = `Callback with id ${cbID}: ${module}.${method}() not found`;
> 204 | if (method) {
> > 205 | errorMessage = `The callback ${method}() exists in module ${module}, `
> | ^
> 206 | + `but only one callback may be registered to a function in a native module.`;
> 207 | }
Closes https://github.com/facebook/react-native/pull/8347
Differential Revision: D3475525
Pulled By: javache
fbshipit-source-id: e03b3b3411606e6798dc42c785f847c2eda03b0c
Summary:
If using colors that are not strings react native would warn you of the problem. I made some changes so color props use `ColorPropType` instead of `PropTypes.string`.
Closes https://github.com/facebook/react-native/pull/8325
Differential Revision: D3475516
Pulled By: javache
fbshipit-source-id: b7e40a0de5e665fc5f41a975650bbba0ec210814
Summary:
Ensure all `props` have documentation. Add more details to current `props`.
Provide more information to the API in general.
> Would like to try to integrate the React Native Web Player for the initial
> example, but not right now.
Closes https://github.com/facebook/react-native/pull/8341
Differential Revision: D3475105
Pulled By: caabernathy
fbshipit-source-id: 00ad30b2359831740715517278bec1d0231e089d
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?
This adds support for a text field that the user can click-and-drag to select text (which can then be copied using the native selected-text-hover-widget).
I'd love to add this to iOS too, but iOS appears to draw glyphs directly to the screen for its <Text> widget (versus using UITextField), so it might be too difficult to support there. But at least I can support my Android users with this change.
Let me know if/what kind of "demonstrate the code is solid" you would like for this. A screenshot of selected text with this property set?
Closes https://github.com/facebook/react-native/pull/8028
Differential Revision: D3474196
Pulled By: bestander
fbshipit-source-id: 8d3656681265a0e6229bfa13ff2ae021e894d3cd
Summary:
1. Animation guide page is the only place where Flowtype is used, it would be better to remove it to prevent some confusion.
2. ES2015 classes in guidelines docs pages and fixed some typos
**Test plan (required)**
Should i write any tests for this?
Closes https://github.com/facebook/react-native/pull/8339
Differential Revision: D3474192
Pulled By: bestander
fbshipit-source-id: 5531d1e399eaed0952732ac2e0bd1effc72d00a8
Summary:
This will let the JSC exception handling catch the error, and
display it in a red box.
Reviewed By: yungsters
Differential Revision: D3468336
fbshipit-source-id: b89335dbcebf16a881bba783c68242e2b0cd509f
Summary:
The motivation is that the getting started page was not working in some cases in Firefox.
This line of code appears to be at best a no-op, at worst fails in Firefox, since "event" is undefined.
Closes https://github.com/facebook/react-native/pull/8335
Differential Revision: D3473333
Pulled By: JoelMarcey
fbshipit-source-id: 40581e83126675aa072c6ee25609cfb787015ce7