From 1b2991f3ffc8dd04abf8957beee0f1ace4362790 Mon Sep 17 00:00:00 2001 From: Ethan Sharabi <1780255+ethanshar@users.noreply.github.com> Date: Thu, 16 Feb 2023 10:56:42 +0200 Subject: [PATCH] V7 - Upgrade typescript to latest version 4.9.5 and fix errors --- package.json | 2 +- src/components/button/Button.driver.ts | 2 +- src/components/hint/index.tsx | 4 ++-- src/components/text/Text.driver.ts | 2 +- src/incubator/toast/index.tsx | 1 - 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 06e02a0107..af96d92f6b 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "react-test-renderer": "^17.0.1", "reassure": "^0.4.1", "shell-utils": "^1.0.10", - "typescript": "4.3.2", + "typescript": "4.9.5", "postcss": "^8.4.21", "postcss-js": "^4.0.0" }, diff --git a/src/components/button/Button.driver.ts b/src/components/button/Button.driver.ts index 56cdb261bc..ad6b51c1d8 100644 --- a/src/components/button/Button.driver.ts +++ b/src/components/button/Button.driver.ts @@ -17,7 +17,7 @@ export class ButtonDriver extends ComponentDriver { } isPressable = async () => { - if (this.exists()) { + if (await this.exists()) { return typeof (await this.getElementProps()).onPress === 'function'; } else { console.warn(`TextDriver: cannot click because testID:${this.testID} were not found`); diff --git a/src/components/hint/index.tsx b/src/components/hint/index.tsx index d708b90a15..a8aba986db 100644 --- a/src/components/hint/index.tsx +++ b/src/components/hint/index.tsx @@ -538,7 +538,7 @@ class Hint extends Component { return ( - {React.cloneElement(children, { + {React.cloneElement(children, { collapsable: false, key: 'mock', style: [children.props.style, styles.mockChildren] @@ -552,7 +552,7 @@ class Hint extends Component { const {targetFrame} = this.props; if (!targetFrame && isValidElement(this.props.children)) { - return React.cloneElement(this.props.children, { + return React.cloneElement(this.props.children, { key: 'clone', collapsable: false, onLayout: this.onTargetLayout, diff --git a/src/components/text/Text.driver.ts b/src/components/text/Text.driver.ts index ee8a3ecb72..69e46e8d69 100644 --- a/src/components/text/Text.driver.ts +++ b/src/components/text/Text.driver.ts @@ -11,7 +11,7 @@ export class TextDriver extends ComponentDriver { } isPressable = async () => { - if (this.exists()) { + if (await this.exists()) { return typeof (await this.getElementProps()).onPress === 'function'; } else { console.warn(`TextDriver: cannot click because testID:${this.testID} were not found`); diff --git a/src/incubator/toast/index.tsx b/src/incubator/toast/index.tsx index f4ecee56ed..87331ff158 100644 --- a/src/incubator/toast/index.tsx +++ b/src/incubator/toast/index.tsx @@ -57,7 +57,6 @@ const Toast = (props: PropsWithChildren) => { const playAccessibilityFeatures = () => { if (visible) { if (viewRef.current && action) { - // @ts-expect-error const reactTag = findNodeHandle(viewRef.current); AccessibilityInfo.setAccessibilityFocus(reactTag!); } else if (message) {