Skip to content

Commit 20e989c

Browse files
committed
fix
1 parent ad8e142 commit 20e989c

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

packages/@office-iss/react-native-win32/src-win/Libraries/Components/EnterString.win32.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class EnterStringNative extends React.Component<IEnterStringNativeProps, {}> {
7676
disabled: false,
7777
value: '',
7878
label: '',
79-
onChanged: null,
79+
onChanged: undefined,
8080
};
8181

8282
public render() {
@@ -91,7 +91,7 @@ export default class EnterString extends React.Component<IEnterStringProps, {}>
9191
disabled: false,
9292
value: '',
9393
label: '',
94-
onChanged: null,
94+
onChanged: undefined,
9595
};
9696

9797
public render() {

packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/TouchableWin32.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)