8
8
*
9
9
* @providesModule Text
10
10
* @flow
11
+ * @format
11
12
*/
12
13
'use strict' ;
13
14
@@ -422,10 +423,10 @@ const Text = createReactClass({
422
423
return { isInAParentText : true } ;
423
424
} ,
424
425
childContextTypes : {
425
- isInAParentText : PropTypes . bool
426
+ isInAParentText : PropTypes . bool ,
426
427
} ,
427
428
contextTypes : {
428
- isInAParentText : PropTypes . bool
429
+ isInAParentText : PropTypes . bool ,
429
430
} ,
430
431
/**
431
432
* Only assigned if touch is needed.
@@ -448,10 +449,11 @@ const Text = createReactClass({
448
449
if ( this . props . onStartShouldSetResponder || this . _hasPressHandler ( ) ) {
449
450
if ( ! this . _handlers ) {
450
451
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 ( ) ;
455
457
const setResponder = shouldSetFromProps || this . _hasPressHandler ( ) ;
456
458
if ( setResponder && ! this . touchableHandleActivePressIn ) {
457
459
// Attach and bind all the other handlers only the first time a touch
@@ -462,7 +464,10 @@ const Text = createReactClass({
462
464
}
463
465
}
464
466
this . touchableHandleActivePressIn = ( ) => {
465
- if ( this . props . suppressHighlighting || ! this . _hasPressHandler ( ) ) {
467
+ if (
468
+ this . props . suppressHighlighting ||
469
+ ! this . _hasPressHandler ( )
470
+ ) {
466
471
return ;
467
472
}
468
473
this . setState ( {
@@ -471,7 +476,10 @@ const Text = createReactClass({
471
476
} ;
472
477
473
478
this . touchableHandleActivePressOut = ( ) => {
474
- if ( this . props . suppressHighlighting || ! this . _hasPressHandler ( ) ) {
479
+ if (
480
+ this . props . suppressHighlighting ||
481
+ ! this . _hasPressHandler ( )
482
+ ) {
475
483
return ;
476
484
}
477
485
this . setState ( {
@@ -513,12 +521,15 @@ const Text = createReactClass({
513
521
this . props . onResponderTerminate &&
514
522
this . props . onResponderTerminate . apply ( this , arguments ) ;
515
523
} . bind ( this ) ,
516
- onResponderTerminationRequest : function ( ) : bool {
524
+ onResponderTerminationRequest : function ( ) : boolean {
517
525
// Allow touchable or props.onResponderTerminationRequest to deny
518
526
// the request
519
527
var allowTermination = this . touchableHandleResponderTerminationRequest ( ) ;
520
528
if ( allowTermination && this . props . onResponderTerminationRequest ) {
521
- allowTermination = this . props . onResponderTerminationRequest . apply ( this , arguments ) ;
529
+ allowTermination = this . props . onResponderTerminationRequest . apply (
530
+ this ,
531
+ arguments ,
532
+ ) ;
522
533
}
523
534
return allowTermination ;
524
535
} . bind ( this ) ,
@@ -533,7 +544,7 @@ const Text = createReactClass({
533
544
if ( newProps . selectionColor != null ) {
534
545
newProps = {
535
546
...newProps ,
536
- selectionColor : processColor ( newProps . selectionColor )
547
+ selectionColor : processColor ( newProps . selectionColor ) ,
537
548
} ;
538
549
}
539
550
if ( Touchable . TOUCH_TARGET_DEBUG && newProps . onPress ) {
@@ -555,13 +566,13 @@ type RectOffset = {
555
566
left : number ,
556
567
right : number ,
557
568
bottom : number ,
558
- }
569
+ } ;
559
570
560
571
var PRESS_RECT_OFFSET = { top : 20 , left : 20 , right : 20 , bottom : 30 } ;
561
572
562
573
var RCTText = createReactNativeComponentClass (
563
574
viewConfig . uiViewClassName ,
564
- ( ) => viewConfig
575
+ ( ) => viewConfig ,
565
576
) ;
566
577
var RCTVirtualText = RCTText ;
567
578
0 commit comments