Early return for certain input parameter for queryFn
I want to transform this useQuery to trpc
i came up with this but although eslint does not complain this surely is against the rules of react / a bad pattern because I am calling a hook conditionaly, right?
I wrote this hook to get the chat history for existing chats while pasing an empty history to the mutation when creating a new chat. I understand this could be done server side but i want to prevent the unnecessary fetch.
1 Reply
for anyone interested. For now i am using this
It does feel wrong tho.