mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-08 21:52:55 +08:00
Optimize for prop drilling
This commit is contained in:
parent
f77aae6b90
commit
859fd3396b
6 changed files with 28 additions and 43 deletions
|
@ -1,8 +1,10 @@
|
|||
import { useCallback } from '@wordpress/element';
|
||||
import { useAddressEditing } from './useAddressEditing';
|
||||
import useCustomerData from './useCustomerData';
|
||||
|
||||
export const useCardChange = ( fastlaneSdk, setCard, setWooBillingAddress ) => {
|
||||
export const useCardChange = ( fastlaneSdk, setCard ) => {
|
||||
const { setBillingAddressEditing } = useAddressEditing();
|
||||
const { setBillingAddress: setWooBillingAddress } = useCustomerData();
|
||||
|
||||
return useCallback( async () => {
|
||||
if ( fastlaneSdk ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue