From 78a09b7b4e99e4f4521da604b334977664aea695 Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Mon, 16 Oct 2023 15:09:32 +0200 Subject: [PATCH 1/8] ref: moved FormElement to TS --- ios/Podfile.lock | 10 +++++----- src/components/FormElement.js | 16 ---------------- src/components/FormElement.tsx | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 21 deletions(-) delete mode 100644 src/components/FormElement.js create mode 100644 src/components/FormElement.tsx diff --git a/ios/Podfile.lock b/ios/Podfile.lock index cb120bca2b88..db14878a397a 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -251,9 +251,9 @@ PODS: - nanopb/encode (= 2.30908.0) - nanopb/decode (2.30908.0) - nanopb/encode (2.30908.0) - - Onfido (28.3.0) - - onfido-react-native-sdk (8.3.0): - - Onfido (~> 28.3.0) + - Onfido (27.4.0) + - onfido-react-native-sdk (7.4.0): + - Onfido (= 27.4.0) - React - OpenSSL-Universal (1.1.1100) - Plaid (4.1.0) @@ -1204,8 +1204,8 @@ SPEC CHECKSUMS: MapboxMaps: af50ec61a7eb3b032c3f7962c6bd671d93d2a209 MapboxMobileEvents: de50b3a4de180dd129c326e09cd12c8adaaa46d6 nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 - Onfido: c7d010d9793790d44a07799d9be25aa8e3814ee7 - onfido-react-native-sdk: b346a620af5669f9fecb6dc3052314a35a94ad9f + Onfido: e36f284b865adcf99d9c905590a64ac09d4a576b + onfido-react-native-sdk: 4ecde1a97435dcff9f00a878e3f8d1eb14fabbdc OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c Plaid: 7d340abeadb46c7aa1a91f896c5b22395a31fcf2 PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef diff --git a/src/components/FormElement.js b/src/components/FormElement.js deleted file mode 100644 index f46b24708c4c..000000000000 --- a/src/components/FormElement.js +++ /dev/null @@ -1,16 +0,0 @@ -import React, {forwardRef} from 'react'; -import {View} from 'react-native'; -import * as ComponentUtils from '../libs/ComponentUtils'; - -const FormElement = forwardRef((props, ref) => ( - -)); - -FormElement.displayName = 'BaseForm'; -export default FormElement; diff --git a/src/components/FormElement.tsx b/src/components/FormElement.tsx new file mode 100644 index 000000000000..d37e792ca6a6 --- /dev/null +++ b/src/components/FormElement.tsx @@ -0,0 +1,19 @@ +import React, {ForwardedRef, forwardRef} from 'react'; +import {View, ViewStyle} from 'react-native'; +import * as ComponentUtils from '../libs/ComponentUtils'; + +function FormElement(props: {style: ViewStyle; children: React.ReactNode}, ref: ForwardedRef) { + console.debug('hej', JSON.stringify(ref)); + return ( + + ); +} + +FormElement.displayName = 'BaseForm'; +export default forwardRef(FormElement); From d340487aa8a5ed2aa55778d0156b161928d49eb1 Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Tue, 7 Nov 2023 17:23:53 +0100 Subject: [PATCH 2/8] fix: typing --- src/components/FormElement.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/FormElement.tsx b/src/components/FormElement.tsx index d37e792ca6a6..02fab79f1d62 100644 --- a/src/components/FormElement.tsx +++ b/src/components/FormElement.tsx @@ -1,14 +1,13 @@ -import React, {ForwardedRef, forwardRef} from 'react'; -import {View, ViewStyle} from 'react-native'; -import * as ComponentUtils from '../libs/ComponentUtils'; +import React, {ForwardedRef, forwardRef, LegacyRef} from 'react'; +import {View, ViewProps} from 'react-native'; +import * as ComponentUtils from '@libs/ComponentUtils'; -function FormElement(props: {style: ViewStyle; children: React.ReactNode}, ref: ForwardedRef) { - console.debug('hej', JSON.stringify(ref)); +type FormElementProps = ViewProps; +function FormElement(props: FormElementProps, ref: ForwardedRef) { return ( } // eslint-disable-next-line react/jsx-props-no-spreading {...props} /> From b2dc291390a475dff54d4d63654f786bb5b0cfb1 Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Tue, 7 Nov 2023 18:51:03 +0100 Subject: [PATCH 3/8] fix: changed a type --- src/components/FormElement.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FormElement.tsx b/src/components/FormElement.tsx index 02fab79f1d62..555f2ec59c19 100644 --- a/src/components/FormElement.tsx +++ b/src/components/FormElement.tsx @@ -1,4 +1,4 @@ -import React, {ForwardedRef, forwardRef, LegacyRef} from 'react'; +import React, {ForwardedRef, forwardRef} from 'react'; import {View, ViewProps} from 'react-native'; import * as ComponentUtils from '@libs/ComponentUtils'; @@ -7,7 +7,7 @@ function FormElement(props: FormElementProps, ref: ForwardedRef} + ref={ref as ForwardedRef} // eslint-disable-next-line react/jsx-props-no-spreading {...props} /> From 7e7602f5882d2ab7d3375713669e21f676dd74f3 Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Wed, 8 Nov 2023 10:55:45 +0100 Subject: [PATCH 4/8] Revert "ref: moved FormElement to TS" This reverts commit 78a09b7b4e99e4f4521da604b334977664aea695. --- src/components/FormElement.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/FormElement.tsx b/src/components/FormElement.tsx index 555f2ec59c19..42f5452b99db 100644 --- a/src/components/FormElement.tsx +++ b/src/components/FormElement.tsx @@ -3,6 +3,7 @@ import {View, ViewProps} from 'react-native'; import * as ComponentUtils from '@libs/ComponentUtils'; type FormElementProps = ViewProps; + function FormElement(props: FormElementProps, ref: ForwardedRef) { return ( Date: Wed, 8 Nov 2023 11:03:03 +0100 Subject: [PATCH 5/8] Revert "ref: moved FormElement to TS" This reverts commit 78a09b7b4e99e4f4521da604b334977664aea695. --- ios/Podfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 7e80f5c90c7d..97143f53b867 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -251,9 +251,9 @@ PODS: - nanopb/encode (= 2.30908.0) - nanopb/decode (2.30908.0) - nanopb/encode (2.30908.0) - - Onfido (27.4.0) - - onfido-react-native-sdk (7.4.0): - - Onfido (= 27.4.0) + - Onfido (28.3.0) + - onfido-react-native-sdk (8.3.0): + - Onfido (~> 28.3.0) - React - OpenSSL-Universal (1.1.1100) - Plaid (4.1.0) @@ -1209,8 +1209,8 @@ SPEC CHECKSUMS: MapboxMaps: af50ec61a7eb3b032c3f7962c6bd671d93d2a209 MapboxMobileEvents: de50b3a4de180dd129c326e09cd12c8adaaa46d6 nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 - Onfido: e36f284b865adcf99d9c905590a64ac09d4a576b - onfido-react-native-sdk: 4ecde1a97435dcff9f00a878e3f8d1eb14fabbdc + Onfido: c7d010d9793790d44a07799d9be25aa8e3814ee7 + onfido-react-native-sdk: b346a620af5669f9fecb6dc3052314a35a94ad9f OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c Plaid: 7d340abeadb46c7aa1a91f896c5b22395a31fcf2 PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef From f3133cb7b6b801a5e88ddfe2c45797e816223b0a Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Wed, 8 Nov 2023 11:59:00 +0100 Subject: [PATCH 6/8] fix: removed unnecessary type --- src/components/FormElement.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/FormElement.tsx b/src/components/FormElement.tsx index 42f5452b99db..2af2f6af4615 100644 --- a/src/components/FormElement.tsx +++ b/src/components/FormElement.tsx @@ -2,9 +2,7 @@ import React, {ForwardedRef, forwardRef} from 'react'; import {View, ViewProps} from 'react-native'; import * as ComponentUtils from '@libs/ComponentUtils'; -type FormElementProps = ViewProps; - -function FormElement(props: FormElementProps, ref: ForwardedRef) { +function FormElement(props: ViewProps, ref: ForwardedRef) { return ( Date: Thu, 9 Nov 2023 11:20:55 +0100 Subject: [PATCH 7/8] fix: changed dispalyName of component --- src/components/FormElement.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FormElement.tsx b/src/components/FormElement.tsx index 2af2f6af4615..dcf17af4362f 100644 --- a/src/components/FormElement.tsx +++ b/src/components/FormElement.tsx @@ -13,6 +13,6 @@ function FormElement(props: ViewProps, ref: ForwardedRef Date: Wed, 15 Nov 2023 18:29:44 +0100 Subject: [PATCH 8/8] fix: resolve comments --- src/components/FormElement.tsx | 4 ++-- src/components/SignInPageForm/index.tsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/FormElement.tsx b/src/components/FormElement.tsx index dcf17af4362f..c61a09b9d1ec 100644 --- a/src/components/FormElement.tsx +++ b/src/components/FormElement.tsx @@ -2,11 +2,11 @@ import React, {ForwardedRef, forwardRef} from 'react'; import {View, ViewProps} from 'react-native'; import * as ComponentUtils from '@libs/ComponentUtils'; -function FormElement(props: ViewProps, ref: ForwardedRef) { +function FormElement(props: ViewProps, ref: ForwardedRef) { return ( } + ref={ref} // eslint-disable-next-line react/jsx-props-no-spreading {...props} /> diff --git a/src/components/SignInPageForm/index.tsx b/src/components/SignInPageForm/index.tsx index 1cdc31b33fd9..20b93e6db1b5 100644 --- a/src/components/SignInPageForm/index.tsx +++ b/src/components/SignInPageForm/index.tsx @@ -1,4 +1,5 @@ import React, {useEffect, useRef} from 'react'; +import {View} from 'react-native'; import FormElement from '@components/FormElement'; import SignInPageFormProps from './types'; @@ -9,7 +10,7 @@ const preventFormDefault = (event: SubmitEvent) => { }; function SignInPageForm(props: SignInPageFormProps) { - const form = useRef(null); + const form = useRef(null); useEffect(() => { const formCurrent = form.current;