Open johnnyreilly opened 1 month ago
Hey @johnnyreilly and thanks for surfacing this. IMO the addition makes sense at least as a separate information callout in the docs, so thanks for that as well. Did you also think about the case where you need the column definition in advance?
I'll add this to the board as a request to add it to the docs.
As for our aside question: It is still relevant. Most of the time not memoizing might not be noticable at all, but when you use a big number of columns and rows this can become a problem.
As for our aside question: It is still relevant. Most of the time not memoizing might not be noticable at all, but when you use a big number of columns and rows this can become a problem.
Cool - I'll put a note in about memoizing to the post
Did you also think about the case where you need the column definition in advance?
I didn't as in my use cases it's not required. Do you have a particular use case in mind? I guess if you save the column definition away to persistent storage / a database then you couldn't use this perhaps?
As for our aside question: It is still relevant. Most of the time not memoizing might not be noticable at all, but when you use a big number of columns and rows this can become a problem.
Cool - I'll put a note in about memoizing to the post
Did you also think about the case where you need the column definition in advance?
I didn't as in my use cases it's not required. Do you have a particular use case in mind? I guess if you save the column definition away to persistent storage / a database then you couldn't use this perhaps?
Exactly. That's what i was thinking.
Related page
https://mui.com/x/react-data-grid/column-definition/
Kind of issue
Missing information
Issue description
I recently discovered a way to make use of static typing to ensure that columns and rows are aligned; that it's not possible to specify a field if it doesn't actually exist in the rows:
https://johnnyreilly.com/static-typing-for-mui-react-data-grid-columns
Only so many people are likely to happen upon my blog, would it be worth including this information in the actual documentation somewhere?
As an aside, I noticed this advice:
In my own examples I haven't seemed to need to memoize it. Is this piece of information out of date?
Context
https://github.com/johnnyreilly/blog.johnnyreilly.com/pull/956
Search keywords: Data Grid