Answer Overflow Logo
Change Theme
Search Answer Overflow
GitHub
Add Your Server
Login
Home
Popular
Topics
Gaming
Programming
yaviscoke
Explore posts from servers
R
Railway
T
tRPC
TTC
Theo's Typesafe Cult
Posts
Comments
T
tRPC
•
Created by yaviscoke on 5/26/2023 in
#❓-help
How to not send request in specific condition in useQuery()
const
{
data
:
artists
,
isLoading
}
=
api.findArtist.
useQuery
({
name: search,
});
const
{
data
:
artists
,
isLoading
}
=
api.findArtist.
useQuery
({
name: search,
});
I have this in my code so in beginning
search
is empty string and is it possible to write condition when it should run request and when not, when
search
is empty I dont want to run request
4 replies