Skip to content

multiple clients #1523

Answered by JoviDeCroock
Manubi asked this question in Q&A
Apr 6, 2021 · 7 comments · 25 replies
Discussion options

You must be logged in to vote

I'd suggest creating an abstraction over the hooks honestly, where you use the context argument to our hooks to supply a different url. For insance:

const useMyCustomQuery = ({ internal, ...args }) => useQuery(...args, context: useMemo(() => ({ url: internal ? 'x' : 'y' }), [])

Replies: 7 comments 25 replies

Comment options

You must be logged in to vote
4 replies
@Manubi
Comment options

@JoviDeCroock
Comment options

@nandorojo
Comment options

@JoviDeCroock
Comment options

Answer selected by JoviDeCroock
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
11 replies
@ceefour
Comment options

@JoviDeCroock
Comment options

@Manubi
Comment options

@Manubi
Comment options

@kitten
Comment options

Comment options

You must be logged in to vote
4 replies
@remon-nashid
Comment options

@remon-nashid
Comment options

@Mookiies
Comment options

@Manubi
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

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

Comment options

You must be logged in to vote
5 replies
@JoviDeCroock
Comment options

@agcty
Comment options

@JoviDeCroock
Comment options

@mwilc0x
Comment options

@AjayiMike
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet