Closed Mhmdabed11 closed 1 year ago
So, does it work for you, or are you seeing any bugs?
secureFields
, because we want to register callbacks once, as soon as secureFields
has been made availablePlease let us know if something does indeed lead to rendering being buggy.
Problem Description
I am trying to use the react-example-initTokenize sample provided. I noticed that there are missing dependencies in the array in useEffect in the code.
Example 1
In the code below, the useEffect is missing 4 dependencies which are: Here is a link to the code: https://github.com/datatrans/secure-fields-sample/blob/master/react-example-initTokenize/src/SecureFields.js#L51
cleanupSecureFields, initSecureFields, production, secureFields
.Example 2
In the code below, the useEffect is missing some dependancies:![image](https://user-images.githubusercontent.com/39762577/199698908-27e77b3c-0a0d-462b-bd01-6ae32da146e9.png)
cardContainerClassNames, cvvContainerClassNames, secureFields
Here is a link to the code: https://github.com/datatrans/secure-fields-sample/blob/master/react-example-initTokenize/src/SecureFields.js#L73Proposed Solution:
I believe that the dependencies should be added to avoid rendering bugs.