Skip to content

Commit bf9cabb

Browse files
sherginfacebook-github-bot
authored andcommitted
Prettier for Text.js
Summary: Trivial. Reviewed By: sahrens Differential Revision: D6715229 fbshipit-source-id: 13ae84920c98e0d8e8f1b64aeadfa770b64ea3b4
1 parent e758cb7 commit bf9cabb

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

Libraries/Text/Text.js

+24-13
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*
99
* @providesModule Text
1010
* @flow
11+
* @format
1112
*/
1213
'use strict';
1314

@@ -422,10 +423,10 @@ const Text = createReactClass({
422423
return {isInAParentText: true};
423424
},
424425
childContextTypes: {
425-
isInAParentText: PropTypes.bool
426+
isInAParentText: PropTypes.bool,
426427
},
427428
contextTypes: {
428-
isInAParentText: PropTypes.bool
429+
isInAParentText: PropTypes.bool,
429430
},
430431
/**
431432
* Only assigned if touch is needed.
@@ -448,10 +449,11 @@ const Text = createReactClass({
448449
if (this.props.onStartShouldSetResponder || this._hasPressHandler()) {
449450
if (!this._handlers) {
450451
this._handlers = {
451-
onStartShouldSetResponder: (): bool => {
452-
const shouldSetFromProps = this.props.onStartShouldSetResponder &&
453-
// $FlowFixMe(>=0.41.0)
454-
this.props.onStartShouldSetResponder();
452+
onStartShouldSetResponder: (): boolean => {
453+
const shouldSetFromProps =
454+
this.props.onStartShouldSetResponder &&
455+
// $FlowFixMe(>=0.41.0)
456+
this.props.onStartShouldSetResponder();
455457
const setResponder = shouldSetFromProps || this._hasPressHandler();
456458
if (setResponder && !this.touchableHandleActivePressIn) {
457459
// Attach and bind all the other handlers only the first time a touch
@@ -462,7 +464,10 @@ const Text = createReactClass({
462464
}
463465
}
464466
this.touchableHandleActivePressIn = () => {
465-
if (this.props.suppressHighlighting || !this._hasPressHandler()) {
467+
if (
468+
this.props.suppressHighlighting ||
469+
!this._hasPressHandler()
470+
) {
466471
return;
467472
}
468473
this.setState({
@@ -471,7 +476,10 @@ const Text = createReactClass({
471476
};
472477

473478
this.touchableHandleActivePressOut = () => {
474-
if (this.props.suppressHighlighting || !this._hasPressHandler()) {
479+
if (
480+
this.props.suppressHighlighting ||
481+
!this._hasPressHandler()
482+
) {
475483
return;
476484
}
477485
this.setState({
@@ -513,12 +521,15 @@ const Text = createReactClass({
513521
this.props.onResponderTerminate &&
514522
this.props.onResponderTerminate.apply(this, arguments);
515523
}.bind(this),
516-
onResponderTerminationRequest: function(): bool {
524+
onResponderTerminationRequest: function(): boolean {
517525
// Allow touchable or props.onResponderTerminationRequest to deny
518526
// the request
519527
var allowTermination = this.touchableHandleResponderTerminationRequest();
520528
if (allowTermination && this.props.onResponderTerminationRequest) {
521-
allowTermination = this.props.onResponderTerminationRequest.apply(this, arguments);
529+
allowTermination = this.props.onResponderTerminationRequest.apply(
530+
this,
531+
arguments,
532+
);
522533
}
523534
return allowTermination;
524535
}.bind(this),
@@ -533,7 +544,7 @@ const Text = createReactClass({
533544
if (newProps.selectionColor != null) {
534545
newProps = {
535546
...newProps,
536-
selectionColor: processColor(newProps.selectionColor)
547+
selectionColor: processColor(newProps.selectionColor),
537548
};
538549
}
539550
if (Touchable.TOUCH_TARGET_DEBUG && newProps.onPress) {
@@ -555,13 +566,13 @@ type RectOffset = {
555566
left: number,
556567
right: number,
557568
bottom: number,
558-
}
569+
};
559570

560571
var PRESS_RECT_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
561572

562573
var RCTText = createReactNativeComponentClass(
563574
viewConfig.uiViewClassName,
564-
() => viewConfig
575+
() => viewConfig,
565576
);
566577
var RCTVirtualText = RCTText;
567578

0 commit comments

Comments
 (0)