Prettier the rest of ReactNative

Reviewed By: yungsters

Differential Revision: D7974340

fbshipit-source-id: 5fe457a8a9be4bd360fc3af9acb5c1136b2be0d7
This commit is contained in:
Eli White
2018-05-11 13:32:37 -07:00
committed by Facebook Github Bot
parent aba4ec0c09
commit 36fcbaa56d
170 changed files with 5132 additions and 3995 deletions

View File

@@ -4,19 +4,20 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
'use strict';
const React = require('react');
const ReactNative = require('react-native');
const {
Dimensions,
Text,
View
} = ReactNative;
const {Dimensions, Text, View} = ReactNative;
class DimensionsSubscription extends React.Component<{dim: string}, {dims: Object}> {
class DimensionsSubscription extends React.Component<
{dim: string},
{dims: Object},
> {
state = {
dims: Dimensions.get(this.props.dim),
};
@@ -29,7 +30,7 @@ class DimensionsSubscription extends React.Component<{dim: string}, {dims: Objec
Dimensions.removeEventListener('change', this._handleDimensionsChange);
}
_handleDimensionsChange = (dimensions) => {
_handleDimensionsChange = dimensions => {
this.setState({
dims: dimensions[this.props.dim],
});
@@ -49,10 +50,14 @@ exports.description = 'Dimensions of the viewport';
exports.examples = [
{
title: 'window',
render(): React.Element<any> { return <DimensionsSubscription dim="window" />; }
render(): React.Element<any> {
return <DimensionsSubscription dim="window" />;
},
},
{
title: 'screen',
render(): React.Element<any> { return <DimensionsSubscription dim="screen" />; }
render(): React.Element<any> {
return <DimensionsSubscription dim="screen" />;
},
},
];