#useLoader return "undefined"

1 messages · Page 1 of 1 (latest)

carmine trout
#

I running here in a problen i like to understand
const data = useLoaderData<LoaderData>();
This returns all objects
console.log("write>",data.quarterDatesData)
This returns "undefined"
console.log("write>",data)

Have anyone a idea?
Thanks

rich kraken
#

Aren't those the same? Are Are those console.logs called at different components?

carmine trout
#

@rich kraken Sorry, i have update the post no they are in the same component

muted shadow
#

You are storing key value pair in data so data.testa will give you undefined. Try using data[testa], it would result you with "1"