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] Add support for default props from theme #984

Closed
1 task done
oliviertassinari opened this issue Feb 5, 2021 · 0 comments · Fixed by #1019
Closed
1 task done

[DataGrid] Add support for default props from theme #984

oliviertassinari opened this issue Feb 5, 2021 · 0 comments · Fixed by #1019
Assignees
Labels
new feature New feature or request
Milestone

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Feb 5, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

Make it possible to change default values in the component.

Examples 🌈

v4

const theme = {
  props{
    MuiDataGrid: {
      disableColumnFilter: true,
    },
  },
};

<ThemeProvider theme={theme}>
  <XGrid /> // no filters
</ThemeProvider>

v5

const theme = {
  components{
    MuiDataGrid: {
      defaultProps: {
        disableColumnFilter: true,
      },
    },
  },
};

<ThemeProvider theme={theme}>
  <XGrid /> // no filters
</ThemeProvider>

Motivation 🔦

Technical aspect

v5 introduces the notion of useThemeProps, however, it's not available in v4. I would recommend we duplicate the helper in the repo, with a TODO v5 to replace once we upgrade. We can build on top of getThemeProps and useTheme for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants