Summary:
Thanks for submitting a PR! Please read these instructions carefully:
- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.
What existing problem does the pull request solve?
A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.
If you have added code that should be tested, add tests.
Sign the [CLA][2], if you haven't already.
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.
Closes https://github.com/facebook/react-native/pull/13122
Differential Revision: D4763115
Pulled By: hramos
fbshipit-source-id: 5d4852a133d42e3fd6eb084cf491a672cf075c29
Summary: Some more synchronicity, one step at a time.
Reviewed By: davidaurelio
Differential Revision: D4756542
fbshipit-source-id: 0c56dbca61b3da764aa8d28e29c0e20b54de091e
Summary:
The wording had some grammar issues. The instructions were also not as precise as they could be.
Verified on Xcode 8.2.1.
Closes https://github.com/facebook/react-native/pull/13093
Differential Revision: D4763071
Pulled By: hramos
fbshipit-source-id: fe9da098f0e457efba4712db704692f6f4857624
Summary:
Typing "android avd" into the terminal is not supported anymore. The android command is no longer available. There are workarounds, but it involves replacing files with the older ones.
Thanks for submitting a PR! Please read these instructions carefully:
- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.
What existing problem does the pull request solve?
A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.
If you have added code that should be tested, add tests.
Sign the [CLA][2], if you haven't already.
Small pull requests are much easier to review and more likely to get merged
Closes https://github.com/facebook/react-native/pull/13096
Reviewed By: AsyncDBConnMarkedDownDBException
Differential Revision: D4762937
Pulled By: AsyncDBConnMarkedDownDBException
fbshipit-source-id: 5289402d7e6934d3493a902247a991cd1d887ec0
Summary:
When using the following component, `this.props.children` is not a flat array.
``` js
class Example extends Component {
// ...
render() {
const values = ['1', '2'];
return (
<Picker
value={this.state.value}
onValueChange={this.onValueChange.bind(this)}
>
<Picker.Item
label="n/a"
value={null}
/>
{values.map(value => {
return (
<Picker.Item
label={value}
value={value}
/>
);
})}
</Picker>
);
}
}
```
The resulting `this.props.children` is:
``` js
[
(child),
[
(child),
(child),
],
];
```
Therefor you can't use `this.props.children[2]` to get the last item.
The Android version of the [Picker](https://facebook.github.io/react-native/do
Closes https://github.com/facebook/react-native/pull/8153
Differential Revision: D4753480
Pulled By: javache
fbshipit-source-id: deb0264746b39303e66c69c191af0c962db39085
Summary:
Added this as part of a random PR to get flow passing. This collides with a similar fix by bvaughn so let's remove mine. Also I messed up and there is a + at the start of the line :o
Closes https://github.com/facebook/react-native/pull/13103
Differential Revision: D4761349
fbshipit-source-id: 0abde66a1ac4c185bbd7142ecd800cf5ac8f3c5b
Summary:
These modules don't exist in React anymore so this causes new apps to redscreen because the packager cannot resolve those modules.
**Test plan**
Tested that this and removing NavigationExperimental (it also uses removed React exports) causes UIExplorer to work again.
Closes https://github.com/facebook/react-native/pull/13095
Differential Revision: D4757762
Pulled By: ericvicenti
fbshipit-source-id: bb246d4c6b15f5d3c71e31f133a468aea220f308
Summary: We want any exception thrown by `_getHasteName` to be captured by the promise instead of breaking the outer stack.
Reviewed By: davidaurelio
Differential Revision: D4754825
fbshipit-source-id: 173c7c8867da73efb198ed3159704d6fd0e7b87d
Summary: In case the sync function throws, it wouldn't be handled through the promise anymore, that is not what we want. So we revert that in this changeset.
Reviewed By: davidaurelio
Differential Revision: D4754740
fbshipit-source-id: 4da360f4b629bbdf9cd284389060429cc9259c2c
Summary:
It's supposed to take a component or a handle, per the arg name, so switch on the type (and handle `null`).
`FlatListExample` no longer crashes.
Reviewed By: bvaughn, sebmarkbage
Differential Revision: D4752619
fbshipit-source-id: 720421f648f7c2049b5cc44f006484eb47d22d86
Summary: Not sure how I missed this in 3ce31c24da
Reviewed By: yungsters
Differential Revision: D4731083
fbshipit-source-id: 860ed9d2f99312cd02b84ba467ba66afc5cdd5c5
Summary:
It was just adding unnecessary complexity. Users should just use standard React perf best practices, like `PureComponent` and `shouldComponentUpdate`.
This should be backwards compatible - existing `shouldItemUpdate` usage will just be ignored and should consider migrating to this pattern:
```
class MyItem extends React.PureComponent {
_onPress = () => {
this.props.onPressItem(this.props.id);
};
render() {
return (
<SomeOtherWidget title={this.props.title} onPress={this._onPress} />
)
}
}
...
_renderItem = ({item}) => (
<MyItem onPressItem={this._onPressItem} title={item.title} id={item.id} />
);
```
Which will automatically prevent re-renders unless the relavent data changes.
Reviewed By: yungsters
Differential Revision: D4730599
fbshipit-source-id: 0f61efe96eb4d95bb3b7c4ec889e3e0e34436e56
Summary:
This adds support for both automagical sticky section headers in
`SectionList` as well as the more free-form `stickyHeaderIndices` on
`FlatList` or `VirtualizedList`.
The basic concept is to take the initial `stickySectionHeaders` and remap them
to the indices corresponding to the mounted subset in the render window. The
main trick here is that the currently stuck header might itself be outside of
the render window, so we need to search the gap to see if that's the case and
render it (with spacers above and below it instead of one big spacer).
In the `SectionList` we simply pre-compute the sticky headers at the same time
as when we scan the sections to determine the flattened length and pass those
to `VirtualizedList`.
This also requires some updates to `ScrollView` to work in the churny
environment of `VirtualizedList`. We propogate the keys on the children to the
animated wrappers so that as items are removed and the indices of the
remaining items change, react can keep proper track of them. We also fix the
scroll back case where new headers are rendered from the top down and aren't
updated with the `setNextLayoutY` callback because the `onLayout` call for the
next header happened before it was mounted. This is done by just tracking all
the layout values in a map and providing them to the sticky components at
render time. This might also improve perf a little by property configuring the
animations syncronously instead of waiting for the `onLayout` callback. We
also need to protect against stale onLayout callbacks and other fun stuff.
== Test Plan ==
https://www.facebook.com/groups/react.native.community/permalink/940332509435661/
Scroll a lot with and without debug mode on. Make sure spinner
still spins and there are no crashes (lots of crashes during development due
to the animated configuration being non-monotonic if anything stale values get
through). Also made sure that tapping a row to change it's height would
properly update the animation configurations so the collision point would
still be correct.
Reviewed By: yungsters
Differential Revision: D4695065
fbshipit-source-id: 855c4e31c8f8b450d32150dbdb2e07f1a9f9f98e
Summary: People might be tempted to try and scrollTo an index that hasn't been rendered yet, which is broken, so instead of jank let's throw.
Reviewed By: yungsters
Differential Revision: D4727402
fbshipit-source-id: b6f9fd5b70b6f076c30141d00b2b9e2a51b14e87
Summary:
We recommend using `react-navigation` over `Navigator`. Adds a link to the new `native-navigation` component as well.
Did not test website generation, this is a comments only edit that should work fine.
Closes https://github.com/facebook/react-native/pull/12963
Differential Revision: D4749072
Pulled By: hramos
fbshipit-source-id: 4506630306c44b24b95c4f5d5a42c1caa9e2cd4e
Summary:
Bug in Android https://code.google.com/p/android/issues/detail?id=33868 causes the RN catalyst instrumentation test to fail with
```
java.lang.ArrayIndexOutOfBoundsException: length=253; index=-1
at android.text.StaticLayout.calculateEllipsis(StaticLayout.java:667)
at android.text.StaticLayout.out(StaticLayout.java:631)
at android.text.StaticLayout.generate(StaticLayout.java:423)
...
```
The fix is to set singleLine to true when there is only one line of text
Reviewed By: AaaChiuuu
Differential Revision: D4562000
fbshipit-source-id: 84248e3982063b767e8b0465effe2321b54a7fa2
Summary: Only pulls in `EventValidator` for development mode, as warnings about invalid events are pointless in production builds.
Reviewed By: javache
Differential Revision: D4745852
fbshipit-source-id: dbab1026df35d54a82e1e620fac08304c58fbeae