@@ -192,7 +192,7 @@ export class TouchableWin32 extends React.Component<ITouchableWin32Props, IInter
192192 private _positionOnActivate : IPosition ;
193193 private _dimensionsOnActivate : IDimensions ;
194194
195- private readonly _internalRef : React . RefObject < ViewWin32 >
195+ private readonly _internalRef : React . RefObject < ViewWin32 | null >
196196
197197 constructor ( props ) {
198198 super ( props ) ;
@@ -268,7 +268,7 @@ export class TouchableWin32 extends React.Component<ITouchableWin32Props, IInter
268268 }
269269
270270 public focus = ( ) => {
271- this . _internalRef . current . focus ( ) ;
271+ this . _internalRef . current ? .focus ( ) ;
272272 }
273273
274274 /**
@@ -298,7 +298,7 @@ export class TouchableWin32 extends React.Component<ITouchableWin32Props, IInter
298298 e . persist ( ) ;
299299
300300 this . _pressOutDelayTimeout && clearTimeout ( this . _pressOutDelayTimeout ) ;
301- this . _pressOutDelayTimeout = null ;
301+ this . _pressOutDelayTimeout = null as unknown as NodeJS . Timeout ;
302302
303303 this . _touchState = 'NOT_RESPONDER' ;
304304 this . _responderID = dispatchID ;
@@ -326,15 +326,15 @@ export class TouchableWin32 extends React.Component<ITouchableWin32Props, IInter
326326 * Handle responder release
327327 */
328328 private readonly _touchableHandleResponderRelease = ( e : IPressEvent ) => {
329- this . _pressInLocation = null ;
329+ this . _pressInLocation = null as unknown as IPressInLocation ;
330330 this . _receiveSignal ( 'RESPONDER_RELEASE' , e ) ;
331331 } ;
332332
333333 /**
334334 * Handle responder terminate
335335 */
336336 private readonly _touchableHandleResponderTerminate = ( e : IPressEvent ) => {
337- this . _pressInLocation = null ;
337+ this . _pressInLocation = null as unknown as IPressInLocation ;
338338 this . _receiveSignal ( 'RESPONDER_TERMINATED' , e ) ;
339339 } ;
340340
@@ -357,10 +357,10 @@ export class TouchableWin32 extends React.Component<ITouchableWin32Props, IInter
357357 bottom : PRESS_EXPAND_DIPS ,
358358 } ;
359359
360- let pressExpandLeft = pressRectOffset . left ;
361- let pressExpandTop = pressRectOffset . top ;
362- let pressExpandRight = pressRectOffset . right ;
363- let pressExpandBottom = pressRectOffset . bottom ;
360+ let pressExpandLeft = pressRectOffset . left ! ;
361+ let pressExpandTop = pressRectOffset . top ! ;
362+ let pressExpandRight = pressRectOffset . right ! ;
363+ let pressExpandBottom = pressRectOffset . bottom ! ;
364364
365365 // TODO implement touchableGetHitSlop natively
366366 const hitSlop = this . props . touchableGetHitSlop ? this . props . touchableGetHitSlop ( ) : null ;
@@ -427,12 +427,12 @@ export class TouchableWin32 extends React.Component<ITouchableWin32Props, IInter
427427 } ;
428428
429429 private readonly _handleDelay = ( e : IPressEvent ) => {
430- this . _touchableDelayTimeout = null ;
430+ this . _touchableDelayTimeout = null as unknown as NodeJS . Timeout ;
431431 this . _receiveSignal ( 'DELAY' , e ) ;
432432 } ;
433433
434434 private readonly _handleLongDelay = ( e : IPressEvent ) => {
435- this . _longPressDelayTimeout = null ;
435+ this . _longPressDelayTimeout = null as unknown as NodeJS . Timeout ;
436436 const currState = this . _touchState ;
437437
438438 if ( currState !== 'RESPONDER_ACTIVE_PRESS_IN' && currState !== 'RESPONDER_ACTIVE_LONG_PRESS_IN' ) {
@@ -455,7 +455,7 @@ export class TouchableWin32 extends React.Component<ITouchableWin32Props, IInter
455455 private readonly _receiveSignal = ( signal : ISignal , e : IPressEvent ) => {
456456 const responderID = this . _responderID ;
457457 const currState = this . _touchState ;
458- const nextState : IState = transitions [ currState ] ? transitions [ currState ] [ signal ] : null ;
458+ const nextState : IState | null = transitions [ currState ] ? transitions [ currState ] [ signal ] : null ;
459459
460460 if ( ! nextState ) {
461461 const errorMessage = 'Unrecognized signal ' + signal + ' or state ' + currState + ' for Touchable responder ' + responderID + '.' ;
@@ -474,7 +474,7 @@ export class TouchableWin32 extends React.Component<ITouchableWin32Props, IInter
474474
475475 private readonly _cancelLongPressDelayTimeout = ( ) => {
476476 this . _longPressDelayTimeout && clearTimeout ( this . _longPressDelayTimeout ) ;
477- this . _longPressDelayTimeout = null ;
477+ this . _longPressDelayTimeout = null as unknown as NodeJS . Timeout ;
478478 } ;
479479
480480 private readonly _isHighlight = ( state : IState ) => {
@@ -546,7 +546,7 @@ export class TouchableWin32 extends React.Component<ITouchableWin32Props, IInter
546546 }
547547
548548 this . _touchableDelayTimeout && clearTimeout ( this . _touchableDelayTimeout ) ;
549- this . _touchableDelayTimeout = null ;
549+ this . _touchableDelayTimeout = null as unknown as NodeJS . Timeout ;
550550 } ;
551551
552552 private readonly _startHighlight = ( e : IPressEvent ) => {
0 commit comments