Skip to content

Commit

Permalink
fix: HS-132: Fixed multiple re render (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushKapoorJuspay authored Feb 7, 2024
1 parent 16ad6c0 commit 8ffa095
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/Utilities/DynamicFieldsUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ let useRequiredFieldsBody = (
}
}

React.useEffect3(() => {
React.useEffect1(() => {
let requiredFieldsBody =
requiredFields
->Js.Array2.filter(item => item.field_type !== None)
Expand Down Expand Up @@ -492,11 +492,23 @@ let useRequiredFieldsBody = (

setRequiredFieldsBody(_ => requiredFieldsBody)
None
}, (
requiredFields,
[fullName, email, line1, line2, city, postalCode, state, blikCode, phone, billingName],
[currency, country, cardNumber, cardExpiry, cvcNumber],
))
}, [
fullName.value,
email.value,
line1.value,
line2.value,
city.value,
postalCode.value,
state.value,
blikCode.value,
phone.value,
currency,
billingName.value,
country,
cardNumber,
cardExpiry,
cvcNumber,
])
}

let isFieldTypeToRenderOutsideBilling = (fieldType: PaymentMethodsRecord.paymentMethodsFields) => {
Expand Down

0 comments on commit 8ffa095

Please sign in to comment.