Skip to content

Exposing queryKey as an argument in placeholderData & initialData functions #9127

Closed Answered by TkDodo
ugurcanatas asked this question in Ideas
Discussion options

You must be logged in to vote

placeholderData already gets two params - (previousData, previousQuery)

why would you need the queryKey if you could also do:

const someUuid = useSomeUuid()
const anotherUuid = useAnotherUuid()
const queryKey = queryKeyFactory.get(someUuid,anotherUuid)

and then you can close over the queryKey just fine?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ugurcanatas
Comment options

Answer selected by ugurcanatas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants