#CharlieAIO-react-address-element

1 messages · Page 1 of 1 (latest)

stuck crownBOT
unborn rapids
#

It sounds like this script isn't running until after the page renders. Does that sound about right?

vapid minnow
#

yeah basically. Ive tried using the onReady prop but either that doesn't work or I'm not using it correctly

unborn rapids
#

What do you need to set the defaultValue for? That only gets set on the initial load of the form, so doing an asynchronous reload of the page is the only way to change that.

vapid minnow
unborn rapids
#

Taking a look. Will circle back in a few

#

Hmmm, do you have this running somewhere I can view it? In other words, do you have a URL I can use to see it in action?

mystic drift
#

👋 stepping in

#

Catching up one moment

#

Can you add a log to your onChange before you call setName and setAddress and log out the event there @vapid minnow ?

#

Then let's test what happens when you do actually complete the address and see what it logs

#

Hmm wait yeah I'm confused. Let's back up.

#

You are attempting to set the initial state of address and name based on the last state of address and name

#

So on the initial load this is always going to be null

#

If you want the customer to view their current billing information, then you likely want to be passing a prop to your Billing component that contains your stored address/name for that customer that you would retrieve when you authenticate them

crude vessel
#

CharlieAIO-react-address-element