diff --git a/Libraries/Lists/ListView/ListView.js b/Libraries/Lists/ListView/ListView.js
index 5273cc1cb..bb54f1b3d 100644
--- a/Libraries/Lists/ListView/ListView.js
+++ b/Libraries/Lists/ListView/ListView.js
@@ -502,11 +502,7 @@ var ListView = createReactClass({
adjacentRowHighlighted,
);
if (separator) {
- bodyComponents.push(
-
- {separator}
- ,
- );
+ bodyComponents.push({separator});
totalIndex++;
}
}
diff --git a/Libraries/Lists/MetroListView.js b/Libraries/Lists/MetroListView.js
index d168428ce..dde23a226 100644
--- a/Libraries/Lists/MetroListView.js
+++ b/Libraries/Lists/MetroListView.js
@@ -204,11 +204,12 @@ class MetroListView extends React.Component {
);
return renderSectionHeader({section});
};
- _renderSeparator = (sID, rID) =>
+ _renderSeparator = (sID, rID) => (
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error when upgrading Flow's support for React. To see the
* error delete this comment and run Flow. */
- ;
+
+ );
}
module.exports = MetroListView;
diff --git a/Libraries/Lists/ViewabilityHelper.js b/Libraries/Lists/ViewabilityHelper.js
index 370c20fec..3742e607d 100644
--- a/Libraries/Lists/ViewabilityHelper.js
+++ b/Libraries/Lists/ViewabilityHelper.js
@@ -112,8 +112,7 @@ class ViewabilityHelper {
: itemVisiblePercentThreshold;
invariant(
viewablePercentThreshold != null &&
- itemVisiblePercentThreshold !=
- null !==
+ (itemVisiblePercentThreshold != null) !==
(viewAreaCoveragePercentThreshold != null),
'Must set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold',
);
diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js
index eaedc0a2d..9b0e14ffa 100644
--- a/Libraries/Lists/VirtualizedList.js
+++ b/Libraries/Lists/VirtualizedList.js
@@ -605,9 +605,12 @@ class VirtualizedList extends React.PureComponent {
if (stickyIndicesFromProps.has(0)) {
stickyHeaderIndices.push(0);
}
- const element = React.isValidElement(ListHeaderComponent)
- ? ListHeaderComponent // $FlowFixMe
- : ;
+ const element = React.isValidElement(ListHeaderComponent) ? (
+ ListHeaderComponent
+ ) : (
+ // $FlowFixMe
+
+ );
cells.push(
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
@@ -713,9 +716,12 @@ class VirtualizedList extends React.PureComponent {
);
}
} else if (ListEmptyComponent) {
- const element = React.isValidElement(ListEmptyComponent)
- ? ListEmptyComponent // $FlowFixMe
- : ;
+ const element = React.isValidElement(ListEmptyComponent) ? (
+ ListEmptyComponent
+ ) : (
+ // $FlowFixMe
+
+ );
cells.push(
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
@@ -729,9 +735,12 @@ class VirtualizedList extends React.PureComponent {
);
}
if (ListFooterComponent) {
- const element = React.isValidElement(ListFooterComponent)
- ? ListFooterComponent // $FlowFixMe
- : ;
+ const element = React.isValidElement(ListFooterComponent) ? (
+ ListFooterComponent
+ ) : (
+ // $FlowFixMe
+
+ );
cells.push(
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
@@ -942,7 +951,7 @@ class VirtualizedList extends React.PureComponent {
borderColor: 'blue',
borderWidth: 1,
}}>
- {framesInLayout.map((f, ii) =>
+ {framesInLayout.map((f, ii) => (
{
height: f.length * normalize,
backgroundColor: 'orange',
}}
- />,
- )}
+ />
+ ))}
;
+ const itemSeparator = ItemSeparatorComponent && (
+
+ );
const cellStyle = inversionStyle
? horizontal
? [{flexDirection: 'row-reverse'}, inversionStyle]
diff --git a/Libraries/Lists/VirtualizedSectionList.js b/Libraries/Lists/VirtualizedSectionList.js
index 1db79c5c6..ca3a87082 100644
--- a/Libraries/Lists/VirtualizedSectionList.js
+++ b/Libraries/Lists/VirtualizedSectionList.js
@@ -484,19 +484,21 @@ class ItemWithSeparator extends React.Component<
section,
separators: this._separators,
});
- const leadingSeparator =
- LeadingSeparatorComponent &&
- ;
- const separator =
- SeparatorComponent &&
- ;
- return leadingSeparator || separator
- ?
- {leadingSeparator}
- {element}
- {separator}
-
- : element;
+ const leadingSeparator = LeadingSeparatorComponent && (
+
+ );
+ const separator = SeparatorComponent && (
+
+ );
+ return leadingSeparator || separator ? (
+
+ {leadingSeparator}
+ {element}
+ {separator}
+
+ ) : (
+ element
+ );
}
}
diff --git a/Libraries/Lists/__flowtests__/FlatList-flowtest.js b/Libraries/Lists/__flowtests__/FlatList-flowtest.js
index 02d744f67..3fe757b63 100644
--- a/Libraries/Lists/__flowtests__/FlatList-flowtest.js
+++ b/Libraries/Lists/__flowtests__/FlatList-flowtest.js
@@ -60,13 +60,14 @@ module.exports = {
];
return (
+ renderItem={info => (
{
// $FlowExpectedError - bad widgetCount type 6, should be Object
info.item.widget.missingProp
}
- }
+
+ )}
data={data}
/>
);
diff --git a/Libraries/Lists/__flowtests__/SectionList-flowtest.js b/Libraries/Lists/__flowtests__/SectionList-flowtest.js
index dc6be3c46..b452f736a 100644
--- a/Libraries/Lists/__flowtests__/SectionList-flowtest.js
+++ b/Libraries/Lists/__flowtests__/SectionList-flowtest.js
@@ -19,8 +19,9 @@ function renderMyListItem(info: {item: {title: string}, index: number}) {
return ;
}
-const renderMyHeader = ({section}: {section: {fooNumber: number} & Object}) =>
- ;
+const renderMyHeader = ({section}: {section: {fooNumber: number} & Object}) => (
+
+);
module.exports = {
testGoodDataWithGoodItem() {
diff --git a/Libraries/Lists/__tests__/SectionList-test.js b/Libraries/Lists/__tests__/SectionList-test.js
index 301c9de65..8acc1621e 100644
--- a/Libraries/Lists/__tests__/SectionList-test.js
+++ b/Libraries/Lists/__tests__/SectionList-test.js
@@ -40,20 +40,23 @@ describe('SectionList', () => {
const component = ReactTestRenderer.create(
- }
+ ItemSeparatorComponent={props => (
+
+ )}
ListEmptyComponent={props => }
ListFooterComponent={props => }
ListHeaderComponent={props => }
- SectionSeparatorComponent={props =>
- }
+ SectionSeparatorComponent={props => (
+
+ )}
sections={[
{
renderItem: props => ,
key: 's1',
keyExtractor: (item, index) => item.id,
- ItemSeparatorComponent: props =>
- ,
+ ItemSeparatorComponent: props => (
+
+ ),
data: [{id: 'i1s1'}, {id: 'i2s1'}],
},
{
diff --git a/Libraries/Lists/__tests__/VirtualizedList-test.js b/Libraries/Lists/__tests__/VirtualizedList-test.js
index c4e675a73..645336fb6 100644
--- a/Libraries/Lists/__tests__/VirtualizedList-test.js
+++ b/Libraries/Lists/__tests__/VirtualizedList-test.js
@@ -140,7 +140,7 @@ describe('VirtualizedList', () => {
const component = ReactTestRenderer.create(
+ renderItem={outerInfo => (
{
}}
getItem={(data, index) => data[index]}
getItemCount={data => data.length}
- />}
+ />
+ )}
getItem={(data, index) => data[index]}
getItemCount={data => data.length}
/>,
diff --git a/Libraries/ReactNative/AppContainer.js b/Libraries/ReactNative/AppContainer.js
index f836f08da..3c5e3e2cd 100644
--- a/Libraries/ReactNative/AppContainer.js
+++ b/Libraries/ReactNative/AppContainer.js
@@ -62,20 +62,20 @@ class AppContainer extends React.Component {
'toggleElementInspector',
() => {
const Inspector = require('Inspector');
- const inspector = this.state.inspector
- ? null
- : {
- this.setState(
- s => ({mainKey: s.mainKey + 1}),
- () =>
- updateInspectedViewTag(
- ReactNative.findNodeHandle(this._mainRef),
- ),
- );
- }}
- />;
+ const inspector = this.state.inspector ? null : (
+ {
+ this.setState(
+ s => ({mainKey: s.mainKey + 1}),
+ () =>
+ updateInspectedViewTag(
+ ReactNative.findNodeHandle(this._mainRef),
+ ),
+ );
+ }}
+ />
+ );
this.setState({inspector});
},
);
@@ -116,11 +116,7 @@ class AppContainer extends React.Component {
const Wrapper = this.props.WrapperComponent;
if (Wrapper) {
- innerView = (
-
- {innerView}
-
- );
+ innerView = {innerView};
}
return (
diff --git a/Libraries/ReactNative/YellowBox.js b/Libraries/ReactNative/YellowBox.js
index 365d7f715..e36681458 100644
--- a/Libraries/ReactNative/YellowBox.js
+++ b/Libraries/ReactNative/YellowBox.js
@@ -188,11 +188,9 @@ const WarningRow = ({count, warning, onPress}) => {
const View = require('View');
const countText =
- count > 1
- ?
- {'(' + count + ') '}
-
- : null;
+ count > 1 ? (
+ {'(' + count + ') '}
+ ) : null;
return (
@@ -267,9 +265,7 @@ const WarningInspector = ({
-
- {countSentence}
-
+ {countSentence}
@@ -280,9 +276,7 @@ const WarningInspector = ({
{stacktraceList}
-
- {warning}
-
+ {warning}
this.dismissWarning(inspecting)}
- onDismissAll={() => this.dismissWarning(null)}
- onMinimize={() => this.setState({inspecting: null})}
- toggleStacktrace={() =>
- this.setState({stacktraceVisible: !stacktraceVisible})}
- />
- : null;
+ inspecting !== null ? (
+ this.dismissWarning(inspecting)}
+ onDismissAll={() => this.dismissWarning(null)}
+ onMinimize={() => this.setState({inspecting: null})}
+ toggleStacktrace={() =>
+ this.setState({stacktraceVisible: !stacktraceVisible})}
+ />
+ ) : null;
const rows = [];
this.state.warningMap.forEach((warningInfo, warning) => {
diff --git a/RNTester/js/CameraRollExample.js b/RNTester/js/CameraRollExample.js
index 00f053698..74188072a 100644
--- a/RNTester/js/CameraRollExample.js
+++ b/RNTester/js/CameraRollExample.js
@@ -48,16 +48,12 @@ class CameraRollExample extends React.Component<
onValueChange={this._onSwitchChange}
value={this.state.bigImages}
/>
-
- {(this.state.bigImages ? 'Big' : 'Small') + ' Images'}
-
+ {(this.state.bigImages ? 'Big' : 'Small') + ' Images'}
-
- {'Group Type: ' + this.state.groupTypes}
-
+ {'Group Type: ' + this.state.groupTypes}
{
this._cameraRollView = ref;
@@ -93,18 +89,10 @@ class CameraRollExample extends React.Component<
-
- {asset.node.image.uri}
-
-
- {locationStr}
-
-
- {asset.node.group_name}
-
-
- {new Date(asset.node.timestamp).toString()}
-
+ {asset.node.image.uri}
+ {locationStr}
+ {asset.node.group_name}
+ {new Date(asset.node.timestamp).toString()}
diff --git a/RNTester/js/CheckBoxExample.js b/RNTester/js/CheckBoxExample.js
index f868dd26e..9e7b8f5db 100644
--- a/RNTester/js/CheckBoxExample.js
+++ b/RNTester/js/CheckBoxExample.js
@@ -70,9 +70,7 @@ class EventCheckBoxExample extends React.Component<{}, $FlowFixMeState> {
style={{marginBottom: 10}}
value={this.state.eventCheckBoxIsOn}
/>
-
- {this.state.eventCheckBoxIsOn ? 'On' : 'Off'}
-
+ {this.state.eventCheckBoxIsOn ? 'On' : 'Off'}
{
style={{marginBottom: 10}}
value={this.state.eventCheckBoxRegressionIsOn}
/>
-
- {this.state.eventCheckBoxRegressionIsOn ? 'On' : 'Off'}
-
+ {this.state.eventCheckBoxRegressionIsOn ? 'On' : 'Off'}
);
diff --git a/RNTester/js/WebSocketExample.js b/RNTester/js/WebSocketExample.js
index 070512a3e..a859c5cc7 100644
--- a/RNTester/js/WebSocketExample.js
+++ b/RNTester/js/WebSocketExample.js
@@ -38,16 +38,10 @@ const WS_STATES = [
class Button extends React.Component {
render(): React.Element {
- const label = (
-
- {this.props.label}
-
- );
+ const label = {this.props.label};
if (this.props.disabled) {
return (
-
- {label}
-
+ {label}
);
}
return (
@@ -62,14 +56,8 @@ class Row extends React.Component {
render(): React.Element {
return (
-
- {this.props.label}
-
- {this.props.value
- ?
- {this.props.value}
-
- : null}
+ {this.props.label}
+ {this.props.value ? {this.props.value} : null}
{this.props.children}
);