Summary:
This allows the `NavigationCard` style to be extended, the default `backgroundColor` style of the `NavigationCard` is not applicable to all apps.
Fixes issue #8116. PR #8115 was already made for this but didn't pass CI checks.
**Test plan**
When rendering a NavigationCardStack, add
```
const { CardStack } = NavigationExperimental;
...
<CardStack cardStyle={{ backgroundColor: 'purple' }} />
```
to see that the `NavigationCard` background has changed to purple.
Closes https://github.com/facebook/react-native/pull/8471
Differential Revision: D3508849
Pulled By: javache
fbshipit-source-id: 65703cccf3d01def9f2060256f0ff564bbdc47d3
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.
Closes https://github.com/facebook/react-native/pull/8095
Reviewed By: bestander
Differential Revision: D3492788
Pulled By: andreicoman11
fbshipit-source-id: 1eda9196d7125da19a8d7baaab22b61b744ca629
Summary:
**Motivation**
The prop validation was run on every render, even in prod which seems odd to me. This adds a dev check to make sure prod build skips the validation.
**Test plan (required)**
There are no changes to the ui.
Closes https://github.com/facebook/react-native/pull/8499
Differential Revision: D3508805
Pulled By: javache
fbshipit-source-id: 68c6a1224e33997f9df93481426daff790ef5bcd
Summary:
Its a minor Bug fix for rendering Title in NavigationHeader
Closes https://github.com/facebook/react-native/pull/8437
Differential Revision: D3507319
Pulled By: ericvicenti
fbshipit-source-id: ff4aa36be3c4991be11aabecbaad952c015a60e2
Summary:
Currently the algorithm for calculating frames will not always have an correct value for the endframe making some natively driven animations stuck almost at the end. This PR ensures the animation ends at `1`.
**Test plan**
Tested with the code in `NativeAnimationsExample.js`.
Closes https://github.com/facebook/react-native/pull/8489
Differential Revision: D3502973
fbshipit-source-id: b9b114d3982341571ac6ff315620d3d2292d9266
Summary:
* Next version of Jest doesn't allow non test files in __tests__ folders.
* I'm trying to switch all tests off of jsdom on react-native. This should save 500ms of time when running a single test because jsdom is slow to load and react-native is also not supposed to run in a DOM environment, so let's not pretend we are providing the DOM in tests.
* Make the bridge config configurable so that when we disable automocking and we reset the registry we can redefine the value.
Oh also, stop using lodash in Server.js. First off, lodash 3 doesn't work in Jest's node env because it does some crazy stuff, second because we don't need to load all of lodash for debounce.
Reviewed By: davidaurelio
Differential Revision: D3502886
fbshipit-source-id: 1da1cfba9ed12264d81945b702e7a429d5f84424
Summary:
This follows up the PR https://github.com/facebook/react-native/pull/8306
= Changes
1. Provides the TransitionProps (current and previous) to the function
`configureTransition`.
2. Adds a new member `timing` to `NavigationTransitionSpec`.
= Why
1. Helps people to customize the animation between transitions
2. Helps people to migrate from the deprecated `applyAnimation` prop.
Reviewed By: ericvicenti
Differential Revision: D3470802
fbshipit-source-id: be49becccd53aed7bc57093da1c7dae20153febd
Summary:
Arrow functions do not have their own arguments. Fix EventEmitter#once to pass the correct arguments to the listener callback.
Closes https://github.com/facebook/react-native/pull/8479
Differential Revision: D3495086
Pulled By: javache
fbshipit-source-id: 4492d13bfb2cc255afdc41d39fbf2f35da6b7094
Summary: Add support inlining images into text inputs. For now this is only available on Android.
Reviewed By: andreicoman11
Differential Revision: D3470805
fbshipit-source-id: 14db05ec4d5af549bf314b903654314f39bf73ea
Summary:
JS codes sometimes report exceptions with `null` details about stack traces, resulting in native `NullPointerException` crashes when parsing the stack traces.
Added null checking for the stack traces in `ExceptionsManager.js`, ensuring that we never call `updateExceptionMessage` with a null stack
Reviewed By: foghina
Differential Revision: D3455783
fbshipit-source-id: 027969afd8a5d6015e97fce0a26626730cfc83a4
Summary:
This updates the documentation for the `Text` component itself and the embedded `Text.md` that goes with it.
- React Native Web Player
- Document all props
- NOTE: I actually added a new prop to `Text` called `accessible` since it was set by default and thus shown in the Props list
in the original documentation (but with an empty description).
- Stylistic fixes
Closes https://github.com/facebook/react-native/pull/8445
Differential Revision: D3493112
Pulled By: JoelMarcey
fbshipit-source-id: b428d4eb09065db5c6cb1ae5524ad22084fd2a82
Summary:
RCTPhotoLibraryImageLoader was not using the scale argument so the image loaded wasn't always the right resolution.
**Test plan**
On my iPhone 6, which has `RCTScreenScale() === 2`, see that an `<Image>` rendered with a `ph://XXX` URI is rendered properly in 2x.
More thoroughly, I used `PHAsset.fetchAssetsWithMediaType(.Image, options: fetchOptions)` to fetch PHAssets to get a `asset.localIdentifier` to test. Then, I rendered a `<Image source={{uri: `ph://${localIdentifier}`}} style={{width: 375, height: 375}} />`.
Closes https://github.com/facebook/react-native/pull/8458
Differential Revision: D3492495
fbshipit-source-id: 34b2757f880edf6ff1751773f6e1a0f62c289f5a
Summary:
Fix a bug in NavigationScenesReducer that prevents scenes from re-rendering.
This happens when jumping the index between routes.
The fix is to add an new property `isActive` to `NavigationScene` to indicate the current active scene.
Reviewed By: ericvicenti
Differential Revision: D3479736
fbshipit-source-id: a71419887acd94ad2fead71596ca46419a88efef
Summary:
Hi there,
Here is a fix for #7538 (and #5085).
I had originally discovered this issue when using `resizeMode` through the style props. Although this might arguably be an incorrect usage (see https://github.com/facebook/react-native/issues/4759#issuecomment-164301166) the same issue would happen with the `tintColor` and `overlayColor` style props.
To test this, you can render the following:
```jsx
const imageContainerStyle = {width: 100, height: 100, backgroundColor: 'green', marginLeft: 10, marginTop: 10, };
const imageStyle = {flex: 1, width: undefined, height: undefined, resizeMode: 'contain', };
return (
<View style={styles.container}>
<View style={imageContainerStyle}>
<Image style={imageStyle} source={
{uri:'http://resizing.flixster.com/DeLpPTAwX3O2LszOpeaMHjbzuAw=/53x77/dkpu1ddg7pbsk.cloudfront.net/movie/11/16/47/11164719_ori.jpg'}
}>
</Image>
</View>
<View style={imageContainerStyle}>
<Image style={imageStyle} source={
{
Closes https://github.com/facebook/react-native/pull/8410
Differential Revision: D3488010
Pulled By: andreicoman11
fbshipit-source-id: e9d1283cce8426c8878f9c3c66a43a2141232277
Summary: When layout is measure, transtion props should be updated.
Reviewed By: ericvicenti
Differential Revision: D3479967
fbshipit-source-id: 14bcd96b9691b7ee68689393b4fef51dbd04b69f
Summary: This makes it easy to build Pager.
Reviewed By: ericvicenti
Differential Revision: D3479979
fbshipit-source-id: 71c0536eb190e8ad64feea99e4bda5e2d28801d2
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: bestander
fbshipit-source-id: ce0f7dd62ae0f7dfe6654380821660f8660318a6
Summary:
- Make the examples runnable (both copy/paste and with the web player)
- Add a bit more information in props where needed.
Closes https://github.com/facebook/react-native/pull/8392
Differential Revision: D3482747
Pulled By: caabernathy
fbshipit-source-id: 8f2d812efc1efb3f14db45b5c054ce0d5c14f5f5
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:
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:
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:
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:
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