Repository navigation
Lazy loading
#2433
Replies: 4 comments
|
Can you clarify what is there to lazy load? |
0 replies
|
I mean loading data from backend when you scroll down, or set some filters. E.g I have 100 000 rows by don't want to load them all since it's a lot of data and takes too long. |
0 replies
|
Could try something like this with useSWR: https://swr.vercel.app/ function LazyFormatter(props) {
const { data } = useSWR(`/api/row/${props.row.id}`);
if (!data) return null;
return <>{data.name}</>;
}
function MyGrid() {
const rows = [{ id: 1 }];
return <DataGrid columns={columns} rows={rows} defaultColumnOptions={{ formatter: LazyFormatter }} />;
} |
0 replies
|
You can also use the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is there some example with lazy loading. Or how to implement lazy loading ?
Thank you
All reactions