Skip to content
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

DataGrid valueGetter has confusing intellisense #5823

Closed
2 tasks done
Janpot opened this issue Aug 17, 2022 · 3 comments · Fixed by #5849
Closed
2 tasks done

DataGrid valueGetter has confusing intellisense #5823

Janpot opened this issue Aug 17, 2022 · 3 comments · Fixed by #5849
Labels
component: data grid This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation

Comments

@Janpot
Copy link
Member

Janpot commented Aug 17, 2022

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

The value prop instructs to use getValue, but getValue is deprecated.

Screenshot 2022-08-17 at 16 22 57

Screenshot 2022-08-17 at 16 23 12

Expected behavior 🤔

No response

Steps to reproduce 🕹

Link to live example:

Steps:
1.
2.
3.
4.

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Order ID 💳 (optional)

No response

@Janpot Janpot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 17, 2022
@oliviertassinari oliviertassinari added the component: data grid This is the name of the generic UI component, not the React module! label Aug 17, 2022
@cherniavskii
Copy link
Member

Thanks @Janpot
Looking at #3314, I think the bottom line is to use params.value or params.row rather instead of params.getValue.

@cherniavskii cherniavskii added docs Improvements or additions to the documentation and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 19, 2022
@Janpot
Copy link
Member Author

Janpot commented Aug 19, 2022

The thing that I find unclear about this hint is that I'm already writing the value getter for this column definition. What does the value property represent here? Is it the value that I would receive (e.g. in valueFormatter) if I didn't specify a valueGetter method?

Should the hint rather be something like "The default value for this field that the valueGetter is overriding"?

@cherniavskii
Copy link
Member

@Janpot right, I didn't notice it's for the valueGetter.

Should the hint rather be something like "The default value for this field that the valueGetter is overriding"?

Yes, it should. I'll submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants