diff --git a/src/App.res b/src/App.res index c2c4b7b05..1019e9a3c 100644 --- a/src/App.res +++ b/src/App.res @@ -12,7 +12,7 @@ let make = () => { log }) - React.useEffect1(() => { + React.useEffect(() => { setLoggerState(_ => logger) None }, [logger]) diff --git a/src/Components/AddressPaymentInput.res b/src/Components/AddressPaymentInput.res index 85440988d..8561ba7ae 100644 --- a/src/Components/AddressPaymentInput.res +++ b/src/Components/AddressPaymentInput.res @@ -152,12 +152,12 @@ let make = (~paymentType, ~className="") => { } } - React.useEffect2(() => { + React.useEffect(() => { checkPostalValidity(postalCode, setPostalCode, regex) None }, (regex, country.value)) - React.useEffect1(() => { + React.useEffect(() => { setState(prev => { ...prev, value: "", diff --git a/src/Components/BlikCodePaymentInput.res b/src/Components/BlikCodePaymentInput.res index ced845885..6b24e0d0d 100644 --- a/src/Components/BlikCodePaymentInput.res +++ b/src/Components/BlikCodePaymentInput.res @@ -29,7 +29,7 @@ let make = () => { }) } - React.useEffect1(() => { + React.useEffect(() => { setblikCode(prev => { ...prev, errorString: switch prev.isValid { diff --git a/src/Components/DynamicFields.res b/src/Components/DynamicFields.res index 29b9c9514..3f3f302d3 100644 --- a/src/Components/DynamicFields.res +++ b/src/Components/DynamicFields.res @@ -13,7 +13,7 @@ let make = ( ~cvcProps=None, ~isBancontact=false, ) => { - React.useEffect1(() => { + React.useEffect(() => { setRequiredFieldsBody(_ => Dict.make()) None }, [paymentMethodType]) diff --git a/src/Components/EmailPaymentInput.res b/src/Components/EmailPaymentInput.res index 2688b6c93..ebe697c34 100644 --- a/src/Components/EmailPaymentInput.res +++ b/src/Components/EmailPaymentInput.res @@ -29,7 +29,7 @@ let make = (~paymentType) => { }) } - React.useEffect1(() => { + React.useEffect(() => { setEmail(prev => { ...prev, errorString: switch prev.isValid { diff --git a/src/Components/InputField.res b/src/Components/InputField.res index 74d977ee9..ad88f2d45 100644 --- a/src/Components/InputField.res +++ b/src/Components/InputField.res @@ -73,7 +73,7 @@ let make = ( onBlur(ev) Utils.handleOnBlurPostMessage(~targetOrigin=parentURL, ()) } - React.useEffect2(() => { + React.useEffect(() => { if value->String.length > 0 { setValidClasses() } @@ -105,7 +105,7 @@ let make = ( let concatString = Array.joinWith([cardEmpty, cardComplete, cardInvalid, cardFocused], "") - React.useEffect5(() => { + React.useEffect(() => { Utils.handlePostMessage([ ("id", iframeId->JSON.Encode.string), ("concatedString", concatString->JSON.Encode.string), diff --git a/src/Components/Modal.res b/src/Components/Modal.res index 149594b94..844d0d511 100644 --- a/src/Components/Modal.res +++ b/src/Components/Modal.res @@ -27,7 +27,7 @@ let make = ( }, 450)->ignore } - React.useEffect1(() => { + React.useEffect(() => { loader ? setOpenModal(_ => false) : setOpenModal(_ => true) None }, [loader]) diff --git a/src/Components/PayNowButton.res b/src/Components/PayNowButton.res index f9619cc5e..be9ba38cb 100644 --- a/src/Components/PayNowButton.res +++ b/src/Components/PayNowButton.res @@ -79,7 +79,7 @@ let make = ( let buttonText = sdkHandleConfirmPayment.buttonText->Option.getOr(localeString.payNowButton) - React.useEffect5(() => { + React.useEffect(() => { if showFields { if selectedOption === Card { setIsDisabled(_ => !validFormat) diff --git a/src/Components/PaymentDropDownField.res b/src/Components/PaymentDropDownField.res index 17f7b6644..d42a42c3b 100644 --- a/src/Components/PaymentDropDownField.res +++ b/src/Components/PaymentDropDownField.res @@ -27,7 +27,7 @@ let make = ( } } } - React.useEffect1(() => { + React.useEffect(() => { let initialValue = options->Array.get(0)->Option.getOr("") if ( value.value === "" || diff --git a/src/Components/SavedCardItem.res b/src/Components/SavedCardItem.res index 48c0a52fd..9dff89ff1 100644 --- a/src/Components/SavedCardItem.res +++ b/src/Components/SavedCardItem.res @@ -42,7 +42,7 @@ let make = ( | None => () } } - React.useEffect1(() => { + React.useEffect(() => { isActive ? focusCVC() : () None }, [isActive]) diff --git a/src/Hooks/CommonHooks.res b/src/Hooks/CommonHooks.res index a8e5b1059..523895a17 100644 --- a/src/Hooks/CommonHooks.res +++ b/src/Hooks/CommonHooks.res @@ -32,7 +32,7 @@ external dictToObj: Dict.t<'a> => {..} = "%identity" let useScript = (src: string) => { let (status, setStatus) = React.useState(_ => src != "" ? "loading" : "idle") - React.useEffect1(() => { + React.useEffect(() => { if src == "" { setStatus(_ => "idle") } diff --git a/src/Hooks/Fetcher.res b/src/Hooks/Fetcher.res index b6707acdd..7c193f906 100644 --- a/src/Hooks/Fetcher.res +++ b/src/Hooks/Fetcher.res @@ -7,7 +7,7 @@ type url = {pathname: pathname} let useFetcher = fileName => { let _url = RescriptReactRouter.useUrl() let (optionalJson, setJson) = React.useState(() => None) - React.useEffect1(() => { + React.useEffect(() => { open Promise Fetch.get(`${hostname}/json/${fileName}.json`) ->then(Fetch.Response.json) diff --git a/src/Hooks/OutsideClick.res b/src/Hooks/OutsideClick.res index 03ccb298a..a4c5fe87d 100644 --- a/src/Hooks/OutsideClick.res +++ b/src/Hooks/OutsideClick.res @@ -15,7 +15,7 @@ let useOutsideClick = ( ) => { let useEvent0 = callback => { let callbackRef = React.useRef(callback) - React.useEffect1(() => { + React.useEffect(() => { callbackRef.current = callback None @@ -26,7 +26,7 @@ let useOutsideClick = ( }) } let eventCallback = useEvent0(callback) - React.useEffect1(() => { + React.useEffect(() => { if isActive { let handleClick = (e: ReactEvent.Mouse.t) => { let targ = e->ReactEvent.Mouse.target diff --git a/src/LoaderController.res b/src/LoaderController.res index bc7416e48..a7eaff843 100644 --- a/src/LoaderController.res +++ b/src/LoaderController.res @@ -151,7 +151,7 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger) => { }, ) }, []) - React.useEffect1(() => { + React.useEffect(() => { switch paymentlist { | SemiLoaded => () | Loaded(_val) => handlePostMessage([("ready", true->JSON.Encode.bool)]) @@ -160,7 +160,7 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger) => { None }, [paymentlist]) - React.useEffect1(() => { + React.useEffect(() => { CardUtils.genreateFontsLink(config.fonts) let dict = config.appearance.rules->getDictFromJson if dict->Dict.toArray->Array.length > 0 { @@ -187,7 +187,7 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger) => { None }, [config]) - React.useEffect2(() => { + React.useEffect(() => { open Promise let handleFun = (ev: Window.event) => { let json = try { @@ -394,7 +394,7 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger) => { | None => () } - React.useEffect2(() => { + React.useEffect(() => { Utils.handlePostMessage([ ("iframeHeight", (divH +. 1.0)->JSON.Encode.float), ("iframeId", iframeId->JSON.Encode.string), diff --git a/src/Payment.res b/src/Payment.res index 3855af968..3471f7ca4 100644 --- a/src/Payment.res +++ b/src/Payment.res @@ -62,7 +62,7 @@ let make = (~paymentMode, ~integrateError, ~logger) => { let (postalCodes, setPostalCodes) = React.useState(_ => [PostalCodeType.defaultPostalCode]) - React.useEffect2(() => { + React.useEffect(() => { let obj = getobjFromCardPattern(cardBrand) let cvcLength = obj.maxCVCLenth if ( @@ -211,7 +211,7 @@ let make = (~paymentMode, ~integrateError, ~logger) => { let submitAPICall = (body, confirmParam) => { intent(~bodyArr=body, ~confirmParam, ~handleUserError=false, ()) } - React.useEffect2(() => { + React.useEffect(() => { setCvcNumber(_ => "") setIsCVCValid(_ => None) setCvcError(_ => "") @@ -326,7 +326,7 @@ let make = (~paymentMode, ~integrateError, ~logger) => { Utils.handleMessage(handleFun, "Error in parsing sent Data") }, []) - React.useEffect6(() => { + React.useEffect(() => { let handleDoSubmit = (ev: Window.event) => { let json = ev.data->JSON.parseExn let jsonDict = json->Utils.getDictFromJson @@ -340,7 +340,7 @@ let make = (~paymentMode, ~integrateError, ~logger) => { let cardBrandIcon = getCardBrandIcon(cardBrand->cardType, paymentMode->getPaymentMode) - React.useEffect1(() => { + React.useEffect(() => { setCardError(_ => switch isCardValid { | Some(val) => val ? "" : localeString.inValidCardErrorText @@ -350,7 +350,7 @@ let make = (~paymentMode, ~integrateError, ~logger) => { None }, [isCardValid]) - React.useEffect1(() => { + React.useEffect(() => { setCvcError(_ => switch isCVCValid { | Some(val) => val ? "" : localeString.inCompleteCVCErrorText @@ -360,7 +360,7 @@ let make = (~paymentMode, ~integrateError, ~logger) => { None }, [isCVCValid]) - React.useEffect2(() => { + React.useEffect(() => { setExpiryError(_ => switch (isExpiryValid, isExipryComplete(cardExpiry)) { | (Some(true), true) => "" diff --git a/src/PaymentElement.res b/src/PaymentElement.res index cb1dc8a4d..2a2a87a4d 100644 --- a/src/PaymentElement.res +++ b/src/PaymentElement.res @@ -49,7 +49,7 @@ let make = ( setLoadSavedCards: (PaymentType.savedCardsLoadState => PaymentType.savedCardsLoadState) => unit, ) = React.useState(_ => PaymentType.LoadingSavedCards) - React.useEffect2(() => { + React.useEffect(() => { switch (displaySavedPaymentMethods, customerPaymentMethods) { | (false, _) => { setShowFields(_ => true) @@ -87,7 +87,7 @@ let make = ( None }, (customerPaymentMethods, displaySavedPaymentMethods)) - React.useEffect1(() => { + React.useEffect(() => { let defaultPaymentMethod = savedMethods->Array.find(savedMethod => savedMethod.defaultPaymentMethodSet) @@ -152,7 +152,7 @@ let make = ( areAllApplePayRequiredFieldsPrefilled, )) - React.useEffect4(() => { + React.useEffect(() => { switch methodslist { | Loaded(paymentlist) => let plist = paymentlist->Utils.getDictFromJson->PaymentMethodsRecord.itemToObjMapper @@ -191,14 +191,14 @@ let make = ( } None }, (methodslist, walletList, paymentOptionsList, actualList)) - React.useEffect1(() => { + React.useEffect(() => { switch sessionsObj { | Loaded(ssn) => setSessions(_ => ssn) | _ => () } None }, [sessionsObj]) - React.useEffect2(() => { + React.useEffect(() => { let cardsCount: int = cardsToRender(cardsContainerWidth) let cardOpts = Array.slice(~start=0, ~end=cardsCount, paymentOptions) let dropOpts = paymentOptions->Array.sliceToEnd(~start=cardsCount) @@ -227,7 +227,7 @@ let make = ( } }, [selectedOption]) Utils.useSubmitPaymentData(submitCallback) - React.useEffect4(() => { + React.useEffect(() => { setSelectedOption(prev => selectedOption !== "" ? prev @@ -246,7 +246,7 @@ let make = ( ) None }, (layoutClass.defaultCollapsed, paymentOptions, methodslist, selectedOption)) - React.useEffect1(() => { + React.useEffect(() => { if layoutClass.\"type" == Tabs { let isCard: bool = cardOptions->Array.includes(selectedOption) if !isCard { @@ -388,7 +388,7 @@ let make = ( } - React.useEffect1(() => { + React.useEffect(() => { setShowFields(_ => !displaySavedPaymentMethods) None }, [displaySavedPaymentMethods]) diff --git a/src/PaymentOptions.res b/src/PaymentOptions.res index a8049482d..e8b3638a8 100644 --- a/src/PaymentOptions.res +++ b/src/PaymentOptions.res @@ -57,7 +57,7 @@ let make = ( let (selectedOption, setSelectedOption) = Recoil.useRecoilState(selectedOptionAtom) let (moreIconIndex, setMoreIconIndex) = React.useState(_ => 0) let (toggleIconElement, setToggleIconElement) = React.useState(_ => false) - React.useEffect2(() => { + React.useEffect(() => { let width = switch payOptionsRef.current->Nullable.toOption { | Some(ref) => ref->Window.Element.clientWidth | None => 0 @@ -81,7 +81,7 @@ let make = ( ->Array.find(item => item.paymentMethodName == selectedOption) ->Option.getOr(PaymentMethodsRecord.defaultPaymentMethodFields) - React.useEffect1(() => { + React.useEffect(() => { let intervalId = setInterval(() => { if dropDownOptionsDetails->Array.length > 1 { setMoreIconIndex(prev => mod(prev + 1, dropDownOptionsDetails->Array.length)) diff --git a/src/Payments/ACHBankDebit.res b/src/Payments/ACHBankDebit.res index 978e93a87..2476a4500 100644 --- a/src/Payments/ACHBankDebit.res +++ b/src/Payments/ACHBankDebit.res @@ -36,7 +36,7 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list) (), ) - React.useEffect1(() => { + React.useEffect(() => { if modalData->Option.isSome { setBankError(_ => "") } @@ -50,7 +50,7 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list) modalData->Option.isSome let empty = email.value == "" || fullName.value != "" - React.useEffect2(() => { + React.useEffect(() => { handlePostMessageEvents(~complete, ~empty, ~paymentType="ach_bank_debit", ~loggerState) None }, (empty, complete)) diff --git a/src/Payments/ACHBankTransfer.res b/src/Payments/ACHBankTransfer.res index c45bf9be0..5409c02e3 100644 --- a/src/Payments/ACHBankTransfer.res +++ b/src/Payments/ACHBankTransfer.res @@ -13,12 +13,12 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list) let complete = email.value != "" && email.isValid->Option.getOr(false) let empty = email.value == "" - React.useEffect2(() => { + React.useEffect(() => { handlePostMessageEvents(~complete, ~empty, ~paymentType="bank_transfer", ~loggerState) None }, (empty, complete)) - React.useEffect1(() => { + React.useEffect(() => { setComplete(_ => complete) None }, [complete]) diff --git a/src/Payments/ApplePay.res b/src/Payments/ApplePay.res index dc18694f0..73f4dc8d2 100644 --- a/src/Payments/ApplePay.res +++ b/src/Payments/ApplePay.res @@ -281,7 +281,7 @@ let make = ( ->ignore } - React.useEffect4(() => { + React.useEffect(() => { let handleApplePayMessages = (ev: Window.event) => { let json = try { ev.data->JSON.parseExn @@ -317,7 +317,7 @@ let make = ( ) }, (isInvokeSDKFlow, requiredFieldsBody, isWallet, processPayment)) - React.useEffect4(() => { + React.useEffect(() => { if ( (isInvokeSDKFlow || paymentExperience == PaymentMethodsRecord.RedirectToURL) && isApplePayReady && diff --git a/src/Payments/BacsBankDebit.res b/src/Payments/BacsBankDebit.res index 7647afc27..fa0b40eb7 100644 --- a/src/Payments/BacsBankDebit.res +++ b/src/Payments/BacsBankDebit.res @@ -64,12 +64,12 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list) country.value == "" || state.value == "" - React.useEffect2(() => { + React.useEffect(() => { handlePostMessageEvents(~complete, ~empty, ~paymentType="bacs_bank_debit", ~loggerState) None }, (empty, complete)) - React.useEffect1(() => { + React.useEffect(() => { setComplete(_ => complete) None }, [complete]) diff --git a/src/Payments/BacsBankTransfer.res b/src/Payments/BacsBankTransfer.res index f1e7043b0..2937ecfa8 100644 --- a/src/Payments/BacsBankTransfer.res +++ b/src/Payments/BacsBankTransfer.res @@ -18,12 +18,12 @@ let default = (props: props) => { let complete = email.value != "" && fullName.value != "" && email.isValid->Option.getOr(false) let empty = email.value == "" || fullName.value == "" - React.useEffect2(() => { + React.useEffect(() => { handlePostMessageEvents(~complete, ~empty, ~paymentType="bank_transfer", ~loggerState) None }, (empty, complete)) - React.useEffect1(() => { + React.useEffect(() => { setComplete(_ => complete) None }, [complete]) diff --git a/src/Payments/BecsBankDebit.res b/src/Payments/BecsBankDebit.res index 3323a6fe0..480689121 100644 --- a/src/Payments/BecsBankDebit.res +++ b/src/Payments/BecsBankDebit.res @@ -43,12 +43,12 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list) | None => true } - React.useEffect2(() => { + React.useEffect(() => { handlePostMessageEvents(~complete, ~empty, ~paymentType="becs_bank_debit", ~loggerState) None }, (empty, complete)) - React.useEffect1(() => { + React.useEffect(() => { setComplete(_ => complete) None }, [complete]) diff --git a/src/Payments/Boleto.res b/src/Payments/Boleto.res index 6dd4c0992..0ec536fe6 100644 --- a/src/Payments/Boleto.res +++ b/src/Payments/Boleto.res @@ -44,12 +44,12 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list) ) }, [socialSecurityNumber]) - React.useEffect2(() => { + React.useEffect(() => { handlePostMessageEvents(~complete, ~empty, ~paymentType="boleto", ~loggerState) None }, (complete, empty)) - React.useEffect1(() => { + React.useEffect(() => { setComplete(_ => complete) None }, [complete]) diff --git a/src/Payments/CardPayment.res b/src/Payments/CardPayment.res index fb523f017..3295bb74a 100644 --- a/src/Payments/CardPayment.res +++ b/src/Payments/CardPayment.res @@ -78,12 +78,12 @@ let make = ( let complete = isAllValid(isCardValid, isCVCValid, isExpiryValid, true, "payment") let empty = cardNumber == "" || cardExpiry == "" || cvcNumber == "" - React.useEffect1(() => { + React.useEffect(() => { setComplete(_ => complete) None }, [complete]) - React.useEffect2(() => { + React.useEffect(() => { handlePostMessageEvents(~complete, ~empty, ~paymentType="card", ~loggerState) None }, (empty, complete)) diff --git a/src/Payments/GPay.res b/src/Payments/GPay.res index b78d45e26..6b016c7bc 100644 --- a/src/Payments/GPay.res +++ b/src/Payments/GPay.res @@ -78,7 +78,7 @@ let make = ( ) } - React.useEffect1(() => { + React.useEffect(() => { let handle = (ev: Window.event) => { let json = try { ev.data->JSON.parseExn @@ -196,7 +196,7 @@ let make = ( gpayWrapper.innerHTML = "" gpayWrapper.appendChild(button) } - React.useEffect5(() => { + React.useEffect(() => { if ( status == "ready" && (isGPayReady || @@ -239,7 +239,7 @@ let make = ( paymentExperience == PaymentMethodsRecord.RedirectToURL || isDelayedSessionToken) && isWallet - React.useEffect1(() => { + React.useEffect(() => { areOneClickWalletsRendered(prev => { ...prev, isGooglePay: isRenderGooglePayButton, diff --git a/src/Payments/KlarnaPayment.res b/src/Payments/KlarnaPayment.res index 0a7cd5d91..3dc1accdd 100644 --- a/src/Payments/KlarnaPayment.res +++ b/src/Payments/KlarnaPayment.res @@ -30,11 +30,11 @@ let make = (~paymentType, ~countryProps, ~list: PaymentMethodsRecord.list) => { let complete = email.value != "" && fullName.value != "" && email.isValid->Option.getOr(false) let empty = email.value == "" || fullName.value == "" - React.useEffect2(() => { + React.useEffect(() => { handlePostMessageEvents(~complete, ~empty, ~paymentType="klarna", ~loggerState) None }, (empty, complete)) - React.useEffect1(() => { + React.useEffect(() => { setComplete(_ => complete) None }, [complete]) diff --git a/src/Payments/KlarnaSDK.res b/src/Payments/KlarnaSDK.res index db972057b..6541703cf 100644 --- a/src/Payments/KlarnaSDK.res +++ b/src/Payments/KlarnaSDK.res @@ -66,7 +66,7 @@ let make = (~sessionObj: SessionsType.token, ~list: PaymentMethodsRecord.list) = } useSubmitPaymentData(submitCallback) - React.useEffect1(() => { + React.useEffect(() => { if status == "ready" { let klarnaWrapper = GooglePayType.getElementById(Utils.document, "klarna-payments") klarnaWrapper.innerHTML = "" diff --git a/src/Payments/PaymentMethodsWrapper.res b/src/Payments/PaymentMethodsWrapper.res index be0d10ab4..a49fa98d4 100644 --- a/src/Payments/PaymentMethodsWrapper.res +++ b/src/Payments/PaymentMethodsWrapper.res @@ -45,14 +45,14 @@ let make = ( let complete = areRequiredFieldsValid - React.useEffect1(() => { + React.useEffect(() => { setFieldComplete(_ => complete) None }, [complete]) let empty = areRequiredFieldsEmpty - React.useEffect2(() => { + React.useEffect(() => { handlePostMessageEvents( ~complete, ~empty, diff --git a/src/Payments/QRCodeDisplay.res b/src/Payments/QRCodeDisplay.res index dac09453e..f71c56bef 100644 --- a/src/Payments/QRCodeDisplay.res +++ b/src/Payments/QRCodeDisplay.res @@ -68,7 +68,7 @@ let make = () => { Window.addEventListener("message", handle) Some(() => {Window.removeEventListener("message", handle)}) }, []) - React.useEffect1(() => { + React.useEffect(() => { if expiryTime < 1000.0 { Modal.close(setOpenModal) } diff --git a/src/Payments/SepaBankDebit.res b/src/Payments/SepaBankDebit.res index 461c2549f..18eeb116b 100644 --- a/src/Payments/SepaBankDebit.res +++ b/src/Payments/SepaBankDebit.res @@ -37,12 +37,12 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list) | None => true } - React.useEffect2(() => { + React.useEffect(() => { handlePostMessageEvents(~complete, ~empty, ~paymentType="sepa_bank_debit", ~loggerState) None }, (empty, complete)) - React.useEffect1(() => { + React.useEffect(() => { setComplete(_ => complete) None }, [complete]) diff --git a/src/Payments/SepaBankTransfer.res b/src/Payments/SepaBankTransfer.res index 9c671e4c2..cdf9eddb1 100644 --- a/src/Payments/SepaBankTransfer.res +++ b/src/Payments/SepaBankTransfer.res @@ -28,11 +28,11 @@ let make = ( let complete = email.value != "" && fullName.value != "" && email.isValid->Option.getOr(false) let empty = email.value == "" || fullName.value == "" - React.useEffect2(() => { + React.useEffect(() => { handlePostMessageEvents(~complete, ~empty, ~paymentType="bank_transfer", ~loggerState) None }, (empty, complete)) - React.useEffect1(() => { + React.useEffect(() => { setComplete(_ => complete) None }, [complete]) diff --git a/src/Payments/VoucherDisplay.res b/src/Payments/VoucherDisplay.res index 28bb1381d..335689b23 100644 --- a/src/Payments/VoucherDisplay.res +++ b/src/Payments/VoucherDisplay.res @@ -12,7 +12,7 @@ let make = () => { let (loader, setLoader) = React.useState(_ => true) let linkRef = React.useRef(Nullable.null) - React.useEffect1(() => { + React.useEffect(() => { switch linkRef.current->Nullable.toOption { | Some(link) => link->Window.click | None => () diff --git a/src/SingleLineCardPayment.res b/src/SingleLineCardPayment.res index 8de6123c1..eeb258a8f 100644 --- a/src/SingleLineCardPayment.res +++ b/src/SingleLineCardPayment.res @@ -103,7 +103,7 @@ let make = ( let concatString = Array.joinWith([cardEmpty, cardComplete, cardInvalid, cardFocused], "") - React.useEffect1(() => { + React.useEffect(() => { Utils.handlePostMessage([ ("id", iframeId->JSON.Encode.string), ("concatedString", concatString->JSON.Encode.string), diff --git a/src/Utilities/DynamicFieldsUtils.res b/src/Utilities/DynamicFieldsUtils.res index 01c89feb2..f09bce1e8 100644 --- a/src/Utilities/DynamicFieldsUtils.res +++ b/src/Utilities/DynamicFieldsUtils.res @@ -126,7 +126,7 @@ let useRequiredFieldsEmptyAndValid = ( let fieldsArrWithBillingAddress = fieldsArr->addBillingAddressIfUseBillingAddress(billingAddress) - React.useEffect7(() => { + React.useEffect(() => { let areRequiredFieldsValid = fieldsArr->Array.reduce(true, (acc, paymentMethodFields) => { acc && switch paymentMethodFields { @@ -276,7 +276,7 @@ let useSetInitialRequiredFields = ( logger, ) - React.useEffect1(() => { + React.useEffect(() => { let getNameValue = (item: PaymentMethodsRecord.required_fields) => { requiredFields ->Array.filter(requiredFields => requiredFields.field_type === item.field_type) @@ -478,7 +478,7 @@ let useRequiredFieldsBody = ( } } - React.useEffect1(() => { + React.useEffect(() => { let requiredFieldsBody = requiredFields ->Array.filter(item => item.field_type !== None) diff --git a/src/Utilities/Utils.res b/src/Utilities/Utils.res index 9834865f1..f1226ee5e 100644 --- a/src/Utilities/Utils.res +++ b/src/Utilities/Utils.res @@ -229,7 +229,7 @@ let handleMessage = (fun, _errorMessage) => { Some(() => Window.removeEventListener("message", handle)) } let useSubmitPaymentData = callback => { - React.useEffect1(() => {handleMessage(callback, "")}, [callback]) + React.useEffect(() => {handleMessage(callback, "")}, [callback]) } let useWindowSize = () => { diff --git a/src/orca-log-catcher/ErrorBoundary.res b/src/orca-log-catcher/ErrorBoundary.res index 053e9c232..655464920 100644 --- a/src/orca-log-catcher/ErrorBoundary.res +++ b/src/orca-log-catcher/ErrorBoundary.res @@ -153,7 +153,7 @@ module ErrorCard = { | None => () } - React.useEffect2(() => { + React.useEffect(() => { switch level { | Top => Utils.handlePostMessage([