Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: useCallback changes from 0-7 to useCallback #240

Merged
merged 5 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading