Summary:
This diff adds display:none support to React Native. This enables hiding components which still calling their render method and keeping them within the state of your application. This enables preserving state in a component even though the component is not visible. Previously this was often implemented by rendering a component off screen as a work around. See below playground for usage.
```
class Playground extends React.Component {
render() {
return (
<View style={{width: '100%', height: '100%', flexDirection: 'row', backgroundColor: 'white'}}>
<View style={{width: 100, height: 100, display: 'none', backgroundColor: 'red'}}/>
<View style={{width: 100, height: 100, backgroundColor: 'blue'}}/>
</View>
);
}
}
```
Reviewed By: astreet
Differential Revision: D4611771
fbshipit-source-id: 0dbe0494d989df42994ab9ad5125d47f3233cc5a
Summary: I think these are sufficiently baked. Also beef up comments.
Reviewed By: yungsters
Differential Revision: D4632604
fbshipit-source-id: 64ae6b240a05d62e418099f7403e1781f9b4717c
Summary:
Absolute imports on Windows were broken, I'm not 100% sure when this happens but when I tested Exponent on Windows which uses `rn-cli.config.js` with
```js
getTransformOptions() {
return {
reactNativePath: path.resolve('./node_modules/react-native'),
reactPath: path.resolve('./node_modules/react'),
};
}
```
it seemed to use absolute paths for these modules.
I also tested absolute paths in node repl and it does work for absolute paths of different formats. `C:/root/test.js`, `/root/test.js`, `C:\root\test.js` all do resolve properly to the same module.
To fix this I resolve the absolute path using `path.resolve` on Windows. Noop on other platforms to avoid the overhead since it's not necessary.
**Test plan**
- Tested that it fixed the bug I had when running Exponent on Windows.
- Updated the absolute path test to use forward slashes since this is what happens in practice when using `getTransformOptions`. We can't test all cases on linux since adding the drive letter au
Closes https://github.com/facebook/react-native/pull/12530
Differential Revision: D4634699
Pulled By: jeanlauliac
fbshipit-source-id: 0cf6528069b79cba2e0f79f48f5a524d59b7091e
Summary:
This is #12292, but squashed into a single commit. This should help land the PR cleanly, as the commit history for #12292 was in a bad state: see how 1cbf79d456172c1d348a925d32a7f817df4aaf4b expects `"mkdirp": "^0.5.1"` in `package.json`, but the earlier 66920e4e4b04174d63834d6220c4da76453f27a2 had changed this to `"mkdirp": "*",`.
Verified the website built and run.
Confirmed docs, apis, components were generated.
Confirmed landing page, showcase, blog, docs, help page all load and look as expected.
Closes https://github.com/facebook/react-native/pull/12575
Differential Revision: D4617979
Pulled By: hramos
fbshipit-source-id: 86e2d0b36ccd25fc7f2e9f3b1351f97e7ba64d57
Summary: Simplify the UIExplorer setup, and remove dependency on NavigationExperimental, which is being phased out in favor of React Navigation.
Reviewed By: mkonicek
Differential Revision: D4627131
fbshipit-source-id: 6294623a885074a73c831b0d817770fbe8a90221
Summary:
This should get our node environments to match between internal tests and Travis runs
Closes https://github.com/facebook/react-native/pull/12624
Differential Revision: D4630451
Pulled By: hramos
fbshipit-source-id: 57db3411c9e7b20f13e9f5b37d663fa1726c08e3
Summary:
This will limit Slack's notifications to the #ci channel to whenever the build goes from green to red and vice versa on the default branch (master).
Closes https://github.com/facebook/react-native/pull/12611
Differential Revision: D4629295
Pulled By: hramos
fbshipit-source-id: dc04b774b32b262070c8cd3cc8f88c70a5729217
Summary:
Encourage people to test on the latest stable release.
Closes https://github.com/facebook/react-native/pull/12567
Differential Revision: D4629303
Pulled By: hramos
fbshipit-source-id: d3828607d5c26e562cc418cff8c51ede38d69a6b
Summary:
This switches our React feature flag so that componentWillMount happens before
componentWillUnmount when a child switches. It used to be inconsistent and this
makes it consistent and inline with what React Fiber does.
Breaking change. May cause issues.
Reviewed By: spicyj, bvaughn
Differential Revision: D4626543
fbshipit-source-id: f7eaf1ebd479ca9fada012f903a2f972a7901b40
Summary:
Changed the flex getters to return the values they were actually set. See #421 .
Closes https://github.com/facebook/yoga/pull/431
Reviewed By: astreet
Differential Revision: D4604744
Pulled By: emilsjolander
fbshipit-source-id: 02d79100ef22be866db1c3bd9d53e4447186811f
Summary:
Simple spacing update for consistency.
Super simple PR. I'm just fixing the spacing in the documentation to be consistent with the other docs.
Closes https://github.com/facebook/react-native/pull/12549
Differential Revision: D4608409
Pulled By: hramos
fbshipit-source-id: 9df0e3e0260d292e6788f32a713552c30240da47
Summary:
After a fair bit of use, we have concluded that the `ItemComponent` mechanism is not worth the
hassle. Flow has trouble type checking it thoroughly, requiring an 'item' prop is annoying, and it
is very common to need to capture `this` anyway, e.g. for an `onPress` handler. A common pattern was
something like:
_renderItem = ({item}) => <MyItem foo={item.foo} onPress={() => this._onPress(item)} />};
...
ItemComponent={this._renderItem}
which wouldn't flow check the props and doesn't benefit from reusing components.
If we find some specific patterns that would benefit from the `ItemComponent` pattern, we can create
a new component that provides that API and wraps `FlatList` under the hood.
I'm going to do `SectionList` in a stacked diff.
Reviewed By: bvaughn
Differential Revision: D4625338
fbshipit-source-id: a4901f1c9d77e0115b0b8032b8c210f624e97ea3
Summary: `Viewable` is a weird name - I think `ViewToken` is more clear? Also easier to grep for.
Reviewed By: yungsters, bvaughn
Differential Revision: D4600762
fbshipit-source-id: dbfa5eec1b91166c4889dcb6b87d7832090be9e9
Summary:
It's pretty common to want to wait until the user scrolls a view to consider any items
viewable, so `waitForScroll` enables that behavior.
It's also pretty common to want to ignore items that are quickly scrolled out of view, so we add
`minViewTime` to handle that case.
Reviewed By: bvaughn
Differential Revision: D4595659
fbshipit-source-id: 07bc8e89db63cb68d75bdd9bedde3183c38a3034
Summary:
[Xcode](https://developer.apple.com/xcode/) is spelled with a lowercase `c`. 😄
**Test plan (required)**
ctrl-f project for `XCode`, case sensitive, find-and-replace with `Xcode`.
Make sure tests pass on both Travis and Circle CI.
Closes https://github.com/facebook/react-native/pull/12572
Differential Revision: D4622075
Pulled By: hramos
fbshipit-source-id: d64f0b10254cd624a71844ebaefa6fc29bc1ea57
Summary:
Lists need to be separated by a blank line from the preceding paragraph in order to render properly.
Closes https://github.com/facebook/react-native/pull/12521
Differential Revision: D4619863
Pulled By: ericvicenti
fbshipit-source-id: 4d5019af5ad66d8f4360339f007cf7f39427a945
Summary:
This PR is based on files ericvicenti gave me. Specifically, he gave me:
- AccessibilityInfo.android.js
- AccessibilityInfo.ios.js
- AccessibilityInfoModule.java
Before this change, only a native iOS implementation of AccessibilityInfo existed. This change includes:
- A native Android implementation of AccessibilityInfo.
- JavaScript wrappers for the AccessibilityInfo module for both iOS and Android.
- UIExplorer changes to illustrate how to use AccessibilityInfo on iOS and Android.
- Documentation for the AccessibilityInfo APIs.
**Test plan (required)**
Tested the UIExplorer AccessibilityInfo example on iOS and Android with the screen reader both enabled and disabled.
Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/12273
Reviewed By: mkonicek
Differential Revision: D4527224
Pulled By: ericvicenti
fbshipit-source-id: d04638465ccbdbb35ecfc9504daaeb8e33aab57a
Summary:
* The dev support code moved into a `DevSupport` subspec, meaning that only if the subspec is specified in the user’s Podfile will the packager client, dev menu, etc be included. This is mainly done through checks for header availability.
It also improves the weird situation where you had to specify the `RCTWebSocket` subspec if you wanted to be able to use the packager client during development.
* I removed hardcoding the release version in the podspec on release, because the podspec still relies on `package.json` when evaluating, so there’s no real point in not also getting the version number from there. This should remove any requirement to perform maintenance of the OSS release script regarding the podspec.
Closes https://github.com/facebook/react-native/pull/12602
Differential Revision: D4621021
Pulled By: ericvicenti
fbshipit-source-id: 6c208371fc40ea607809a6ab05dd3714ed9980cf