Inject paymentComponent to phone-sync-handler

This commit is contained in:
Philipp Stracker 2024-09-16 17:52:32 +02:00
parent 55635d11c0
commit 50daa3e99e
No known key found for this signature in database
3 changed files with 6 additions and 2 deletions

View file

@ -36,8 +36,9 @@ const getSanitizedPhoneNumber = ( select ) => {
* Custom hook to synchronize the WooCommerce phone number with a React component state.
*
* @param {Function} setWooPhone - The state setter function for the phone number.
* @param {Object} paymentComponent - The CardField component from Fastlane.
*/
export const usePhoneSyncHandler = ( setWooPhone ) => {
export const usePhoneSyncHandler = ( paymentComponent, setWooPhone ) => {
// Fetch and sanitize phone number from WooCommerce.
const phoneNumber = useSelect( ( select ) =>
getSanitizedPhoneNumber( select )