Skip to content

Commit

Permalink
chore: useCallback changes from 0-7 to useCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed Mar 19, 2024
1 parent fa0d522 commit f84dcf4
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 21 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 @@ -71,7 +71,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
4 changes: 2 additions & 2 deletions src/Hooks/OutsideClick.res
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ let useOutsideClick = (
None
}, [callback])

React.useCallback0(() => {
React.useCallback(() => {
callbackRef.current()
})
}, [])
}
let eventCallback = useEvent0(callback)
React.useEffect1(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/PaymentElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,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 @@ -111,7 +111,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 f84dcf4

Please sign in to comment.