@HugeLetters
I experienced the same error as described in the topic and tried to apply your solution however another problem arose: the query is fetched twice on initial render even though the query key does not change and it only happens when I add placeholderData: prevData. Have you had the same problem??
let prevData;
$: documentLinesQuery = createQuery({
queryKey: ['document-lines', perPage, page, $sorting, filters],
queryFn: async () => {
console.log('fetch')
let url = new URL(`document-lines`, PUBLIC_API_URL);
appendSearchParams({ url, perPage, page, sorting: $sorting, filters });
return await fetch(url).then((res) => res.json());
},
placeholderData: prevData
});
$: if ($documentLinesQuery?.isSuccess) {
prevData = $documentLinesQuery.data;
}

Originally posted by @skelawsky in #5913 (comment)
I'm creating a new post because linked one seems to be closed and not visible to the others.
@HugeLetters
I experienced the same error as described in the topic and tried to apply your solution however another problem arose: the query is fetched twice on initial render even though the query key does not change and it only happens when I add
placeholderData: prevData. Have you had the same problem??Originally posted by @skelawsky in #5913 (comment)
I'm creating a new post because linked one seems to be closed and not visible to the others.