R
Refine

ask-any-question

Data fetching many times

Ccorrect-apricot12/19/2022
Hi everyone! I've got strange behaviour in application, where are too many requests after each click for everything, or after some time, but i do nothing for emitting, maybe you know how to deal with it? maybe i should switch on any strategy in data providers?
No description
Eextended-salmon12/19/2022
which data provider are u using?
Ccorrect-apricot12/19/2022
for example getList
No description
Ccorrect-apricot12/19/2022
in App connection dataProviders looks like this
No description
Eextended-salmon12/19/2022
I dont think it's related to dataprovider. after you clicking the submit button, the app sends 40 request to API ? did i understand correctly ?
Ccorrect-apricot12/19/2022
i can record video, i'll show what happening
Eextended-salmon12/19/2022
it would be great ๐Ÿ‘Š
Ccorrect-apricot12/19/2022
this behaviour
Ccorrect-apricot12/19/2022
just clicking around frame
Eextended-salmon12/19/2022
https://tanstack.com/query/v4/docs/react/guides/window-focus-refetching https://refine.dev/docs/api-reference/core/components/refine-config/#reactquery it seems tanstack query invalidates (refetch again) when you focus on browser. you can disable this behaviour by passing clientConfig options to <Refine> please inform me if this solves the problem btw. you are seeing same request twice. it's probably because of <StrictMode> https://refine.dev/blog/react-strict-mode-in-react-18/ If u temporarily remove <StrictMode> or you can inspect on production build. probably you will not see same request twice
Ccorrect-apricot12/19/2022
let me try) that two points was my solution 1) remove strict mode 2) remove query options)
Eextended-salmon12/19/2022
i'm glad that worked ๐Ÿ™
Ffascinating-indigo1/19/2023
@here I am seeing this problem, I didn't watch the video but a simple load of /{entity}/show/{id} triggers the network request a whoppin' 4 times. Removing <React.StrictMode> reduces it by half, but it's still 2 times. Is this specific bug of strict mode being tracked somewhere ? Is it a bug of React Query ? Hmm, I found this: https://github.com/TanStack/query/issues/3492#issuecomment-1095440683 I didn't have any custom query options, I tried everything I saw here but it had no effect whatsoever. Is Refine using Cancellation ?
GitHub
Infinite Query runs twice on initial load with React 18 ยท Issue #34...
Describe the bug I&#39;m currently using the latest Beta version of React Query with React 18 and noticed my Infinite Query to fetch the initial page two times. As soon as I switch to the React...
Eextended-salmon1/19/2023
Hi @rhengles, i did check this example https://refine.dev/docs/examples/form/mantine/useForm/ and couldn't encounter a problem. It only send 1 request. what is your implementation look like ? can you reproduce the problem ? If you i'm happy to debug. btw, This is not a specific bug of strict mode. it's the expected behaviour I strongly recommend not to remove strict mode. It only works on production mode
Ffascinating-indigo1/19/2023
Right, I'll try to publish it, I'm using the appwrite adapter...
Eextended-salmon1/19/2023
I looked at this example. https://refine.dev/docs/examples/data-provider/appwrite/ it sends 2 request on show but it's for diffrent data. one for category, one for post

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
is it possible to use AuthPage with username instead of email?Hi, i want to use username instead of email on using the AuthPage. However, the input validation forunable to create refine new refine projectthrowing this errorError to include SSR page in resources list on _app.tsxThere is a warning if we use SSR page in resources on _app.tsx For example to use list UserList to gTrying to use Mantine MultiSelect With One 2 Many FieldThe "value" field of the multi select expects ['1','2','3'] but the data being passed by {...getInpuuseFieldArray's update() and replace() reset Dirtyfields in EditThis is a wierd one. When using update() or replace() method from useFieldArray. The Dirtyfields do Redirect to a different resource after createHello, I have this 2 resources `TemplateGroup` and `Template`. Every `Template` belongs to a `Templin useTable updated field is not getting displayed ..in useTable updated field is not getting displayed . if i refresh its showingIs there a quick way to overwrite some data before shipping form?Hi I'm currently using refine with MantineUI, and have a form created with `useForm`, which uses `sdate picker not working in edit form<Form.Item><DatePicker placeholder="Date of Birth" styledefaultProps ignored?but I've a custom component with default props like --------- ./Custom.jsx export const Custom =useCreateManyhow to use onMutationSuccess in useCreateMany hookConditional fallback routing logic, is this possible?Hi all, is it possible to create a conditional routing logic? e.g. route: /custom/edit/:id if id iwhen modal close button is pressed form data is not getting clearedwhen modal close button is pressed form data is not getting cleared in antd formselect field data is not getting clearedhow to clear select field of the previous onescustom success notification for useUpdate hooki want my custom sucess notification for use update hook useUpdate({ successNotifiacation:{ messagusing array of fields in setFilters to searchI want to pass multiple fields in the setFilters, to search the combined first and last name of any I can't serve the app from a sub-directoryI want the base path of my app be `/admin/`. So for example the users list page would be `/admin/useselect getting undefined while changingvalues not getting selectedHow to transform query results before passing them to `useForm`?My api returns a JSON string in one of its endpoints. Something like this ```js { list: "[{id: 1},multi select tag names are not displayed in edit form<Form.Item name={["staff_speciality_mappings"]}> <CustomSelect