Error when reloading/refreshing page #1056
Replies: 3 comments 3 replies
-
Probably because your data is undefined. It needs to be an empty array while loading. |
Beta Was this translation helpful? Give feedback.
3 replies
-
If you pass options like this, no errors:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Resolved it by adding initialData = [] to useQuery |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, can you please point me to the line that is causing this and how to resolve it?
It works on the initial load, then if you re-load the page, it throws an error:
Uncaught TypeError: Cannot read properties of undefined (reading 'length')
Thanks.
`
import { MaterialReactTable, useMaterialReactTable, } from "material-react-table";
import { useQuery } from "@tanstack/react-query";
import axios from "axios";
import { columns } from "./columns";
`
Beta Was this translation helpful? Give feedback.
All reactions