We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi
Datagrid seems to be looking for resource which isnt available in this sample code. Code copied from here: https://marmelab.com/react-admin/useList.html
Please see the project here. https://stackblitz.com/edit/github-8jwzr8vw?file=src%2Findex.tsx,src%2FdashBoard.tsx
I get the following error: "useCanAccess must be used inside a component or provide a resource prop"
Is this expected behavior. Thank you for your time.
useList, ListContextProvider, Datagrid, TextField } from 'react-admin'; const data = [ { id: 1, name: 'Arnold' }, { id: 2, name: 'Sylvester' }, { id: 3, name: 'Jean-Claude' }, ]; const MyComponent = () => { const listContext = useList({ data }); return ( <ListContextProvider value={listContext}> <Datagrid> <TextField source="id" /> <TextField source="name" /> </Datagrid> </ListContextProvider> ); };
The text was updated successfully, but these errors were encountered:
It works when i provide the resource option. <Datagrid resource="data">
<Datagrid resource="data">
Unlike whats mentioned here https://marmelab.com/react-admin/useList.html
Sorry, something went wrong.
Thanks for the report, it is indeed a documentation problem.
24c8891
Successfully merging a pull request may close this issue.
Hi
Datagrid seems to be looking for resource which isnt available in this sample code.
Code copied from here: https://marmelab.com/react-admin/useList.html
Please see the project here.
https://stackblitz.com/edit/github-8jwzr8vw?file=src%2Findex.tsx,src%2FdashBoard.tsx
I get the following error:
"useCanAccess must be used inside a component or provide a resource prop"
Is this expected behavior. Thank you for your time.
The text was updated successfully, but these errors were encountered: