Comments (3)
I ran this code locally and I'm not getting any errors. My Chrome version is different from yours but I'm not getting this error in Firefox either. Do you still get queryClient
error if you run this code in a new React project?
import { Admin } from "react-admin";
import { QueryClient } from "react-query";
import fakeDataProvider from "ra-data-fakerest";
const dataProvider = fakeDataProvider({
posts: [
{ id: 0, title: "Hello, world!" },
{ id: 1, title: "FooBar" },
],
comments: [
{ id: 0, post_id: 0, author: "John Doe", body: "Sensational!" },
{ id: 1, post_id: 0, author: "Jane Doe", body: "I agree" },
],
});
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 1000 * 6 * 5,
refetchOnWindowFocus: false,
},
},
});
const App = () => (
<Admin queryClient={queryClient} dataProvider={dataProvider}></Admin>
);
export default App;
Environment
- React-admin: 4.16.11
- React: 18.2.0
- Browser: 122.0.6261.69 (Chrome)
from react-admin.
@Nela62 If you look at the 'Environment' part of the issue I published, you can see that I am using the latest version, @tanstack/react-query v5. You are importing QueryClient
from react-query, but I am importing it from @tanstack/react-query. As far as I know, react-query is version 3, and @tanstack/react-query is currently version 5. I understand that React-admin recently migrated react-query to v5. Is this correct? #9462
After creating a new project, I installed React-query(older version) and passed queryClient, but no error occurred. However, if I pass queryClient from @tanstack/react-query, I still get an error. Since it has been migrated to v5, I think it is right to import QueryClient
from the latest version. Do I need to set all properties one by one? No related documentation found.
from react-admin.
react-admin uses react-query v3. We're working on integrating tanstack query in next
, but this isn't released yet (it will be in react-admin v5).
I'm closing this issue because there is nothing wrong with react-admin in this case: you must use react-query v3.
from react-admin.
Related Issues (20)
- Add ability to customize query string format for lists HOT 5
- i want to show the received gmail in react js app
- AutoComplete choice listing issue when using useChoicesContext HOT 1
- react admin error with Menu.Item missing properties HOT 6
- storeKey prop is not passed to useRecordSelection hook inside useListController HOT 5
- useEditContext returns null for both values HOT 5
- Infinite loop occurs in page rendering when perPage is set to a negative number in List Component HOT 2
- Codemods are not included in ra-core v5
- Duplicate entries in documentation search HOT 2
- `<PasswordInput/>` or `<TextInput/>` has corrupted `validate` prop, if field is handled with `disabled` prop HOT 4
- Auth provider login Promise rejection with "message" doesn't trigger notification message HOT 1
- When we use useRedirect hook to go back to a List Component, the pagination is reseted to page 1
- <AutocompleteInput> and <AutocompleteInputArray> refetch choises passed from graphql HOT 1
- Fields inside the ArrayInput aren't set as dirty when built HOT 1
- When a form contains ArrayInput with large entries. It takes more than a minute for a form to be submitted. HOT 2
- Bug in Translation in post edit page showing (post "some text here") HOT 1
- Dark mode become default upgrading react-admin package HOT 1
- AutocompleteInput with ReferenceInput calling getList() two times after select on sugestion list HOT 1
- Clearing filters using setFilter({}) does not clear FilterLiveSearch text input
- [Translation] "Need help with this error?" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-admin.