-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
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
[docs] New page presenting the apiRef
#5273
Conversation
|
||
## What is the API object ? | ||
|
||
The API object is an interface containing the state and all the methods needed to interact imperatively with the grid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is probably a little succinct for now
These are the results for the performance tests:
|
apiRef
|
||
You can find a detailed example in the [State page](/x/react-data-grid/state/#access-the-state). | ||
|
||
### Listen to grid events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another suggestion is #5109
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you like to document exactly here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be an example of how to save the state before unmounting the grid. Using the cleanup of useEffect
doesn't work in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you agree to add a section on the State
page in a follow up PR and link it here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions and thoughts:
You can find the list of all the available API methods on the [GridApi page](/x/api/data-grid/grid-api/). | ||
|
||
:::warning | ||
All the methods prefixed by `unstable_` are private. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought unstable_
was used more in the direction of an alpha
version of an API method.
Would it make sense to consider private_
in these cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now it's the same prefix
And right now no unstable_
is documented in a markdown file, even if theoretically we could indeed be used for features in alpha phase.
I suggest we leave it as is (with rewording if you want).
And we discuss if it's worth splitting in two prefixes in another PR.
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
Co-authored-by: José Rodolfo Freitas <joserodolfo.freitas@gmail.com>
Co-authored-by: José Rodolfo Freitas <joserodolfo.freitas@gmail.com>
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Part of #1826 (12)
Fixes #5269
Doc preview: https://deploy-preview-5273--material-ui-x.netlify.app/x/react-data-grid/api-object/
apiRef
and linking to the basic examplesWe could probably use this new page to link to other basic use cases.
For instance a section Accessing the row model inside one of the row pages and linked here would make a lot of sense.