Skip to content

Commit

Permalink
chore: useCallback changes from 0-7 to useCallback (#240)
Browse files Browse the repository at this point in the history
Co-authored-by: Akash Kamble <127744130+akash-c-k@users.noreply.github.com>
  • Loading branch information
Pritish Budhiraja and akash-c-k authored Apr 1, 2024
1 parent 10aa961 commit a88b5df
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/Components/AddressPaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ let make = (~paymentType, ~className="") => {
None
}, [country.value])

let submitCallback = React.useCallback6((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/BillingNamePaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let make = (~paymentType, ~customFieldName=None, ~requiredFields as optionalRequ
}
let nameRef = React.useRef(Nullable.null)

let submitCallback = React.useCallback1((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/BlikCodePaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let make = () => {
None
}, [blikCode.isValid])

let submitCallback = React.useCallback1((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/EmailPaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let make = (~paymentType) => {
None
}, [email.isValid])

let submitCallback = React.useCallback1((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/FullNamePaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let make = (~paymentType, ~customFieldName=None, ~optionalRequiredFields=None) =
}
let nameRef = React.useRef(Nullable.null)

let submitCallback = React.useCallback1((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/PortalCapture.res
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@react.component
let make = React.memo((~name: string) => {
let (_, setPortalNodes) = Recoil.useRecoilState(RecoilAtoms.portalNodes)
let setDiv = React.useCallback2((elem: Nullable.t<Dom.element>) => {
let setDiv = React.useCallback((elem: Nullable.t<Dom.element>) => {
setPortalNodes(
prevDict => {
let clonedDict =
Expand Down
2 changes: 1 addition & 1 deletion src/Components/SavedMethods.res
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ let make = (
}
let empty = cvcNumber == ""

let submitCallback = React.useCallback4((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper
let (token, customerId) = paymentToken
Expand Down
2 changes: 1 addition & 1 deletion src/PaymentElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ let make = (
let cardShimmerCount = React.useMemo1(() => {
cardsToRender(cardsContainerWidth)
}, [cardsContainerWidth])
let submitCallback = React.useCallback1((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit && selectedOption == "" {
Expand Down
2 changes: 1 addition & 1 deletion src/Payments/ACHBankDebit.res
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list)
None
}, (empty, complete))

let submitCallback = React.useCallback3((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper

Expand Down
2 changes: 1 addition & 1 deletion src/Payments/ACHBankTransfer.res
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list)
None
}, [complete])

let submitCallback = React.useCallback1((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
Expand Down
2 changes: 1 addition & 1 deletion src/Payments/BacsBankTransfer.res
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let default = (props: props) => {
None
}, [complete])

let submitCallback = React.useCallback1((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
Expand Down
2 changes: 1 addition & 1 deletion src/Payments/BecsBankDebit.res
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list)
None
}, [complete])

let submitCallback = React.useCallback3((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
Expand Down
2 changes: 1 addition & 1 deletion src/Payments/Boleto.res
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list)
None
}, [complete])

let submitCallback = React.useCallback1((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper

Expand Down
2 changes: 1 addition & 1 deletion src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ let make = (
}
}, (isSaveCardsChecked, list.payment_type))

let submitCallback = React.useCallback6((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper
let (month, year) = CardUtils.getExpiryDates(cardExpiry)
Expand Down
2 changes: 1 addition & 1 deletion src/Payments/KlarnaPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let make = (~paymentType, ~countryProps, ~list: PaymentMethodsRecord.list) => {
None
}, [complete])

let submitCallback = React.useCallback3((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper
let (connectors, _) = list->PaymentUtils.getConnectors(PayLater(Klarna(Redirect)))
Expand Down
2 changes: 1 addition & 1 deletion src/Payments/PaymentMethodsWrapper.res
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ let make = (
None
}, (empty, complete))

let submitCallback = React.useCallback7((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
Expand Down
2 changes: 1 addition & 1 deletion src/Payments/SepaBankDebit.res
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list)
None
}, [complete])

let submitCallback = React.useCallback3((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper

Expand Down
2 changes: 1 addition & 1 deletion src/Payments/SepaBankTransfer.res
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let make = (
None
}, [complete])

let submitCallback = React.useCallback3((ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/DynamicFieldsUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ let useSubmitCallback = () => {

let {localeString} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)

React.useCallback5((ev: Window.event) => {
React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
Expand Down

0 comments on commit a88b5df

Please sign in to comment.