Fetching using useQuery based on changing state causes app to be too slow and throws an error

hello, i am trying to fetch data with a param based on the page the user is on
export default function PcBuilderPartData({
component,
}: {
component: Component;
}) {
api.builder.fetchComponents.useQuery(
{
component,
},
{
refetchOnWindowFocus: false,
refetchOnMount: false,
refetchOnReconnect: false,
}
);
...
export default function PcBuilderPartData({
component,
}: {
component: Component;
}) {
api.builder.fetchComponents.useQuery(
{
component,
},
{
refetchOnWindowFocus: false,
refetchOnMount: false,
refetchOnReconnect: false,
}
);
...
component changes whenever i go to the route of a different component but this has caused it to become too slow whenever i change pages and throws following error:
error - unhandledRejection: TypeError: Cannot read property 'timeoutType' of undefined
at _resume (evalmachine.<anonymous>:11000:33)
at resume (evalmachine.<anonymous>:10969:7)
at connect (evalmachine.<anonymous>:10956:7)
error - unhandledRejection: TypeError: Cannot read property 'timeoutType' of undefined
at _resume (evalmachine.<anonymous>:11000:33)
at resume (evalmachine.<anonymous>:10969:7)
at connect (evalmachine.<anonymous>:10956:7)
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server