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

Cannot override RaReferenceField defaultProps for link #7834

Closed
davidhenley opened this issue Jun 15, 2022 · 2 comments
Closed

Cannot override RaReferenceField defaultProps for link #7834

davidhenley opened this issue Jun 15, 2022 · 2 comments

Comments

@davidhenley
Copy link
Contributor

The following does not override the default link type props:

import {defaultTheme} from "react-admin"

const Theme = {
  ...defaultTheme,
  components: {
    ...defaultTheme.components,
    RaReferenceField: {
      defaultProps: {
        link: "show"
      }
    }
  }
}

https://github.com/marmelab/react-admin/blob/a408de0db2c6db0281b3d39e27c1f2de3deed44e/packages/ra-ui-materialui/src/field/ReferenceField.tsx

@fzaninotto
Copy link
Member

That's because we don't support overriding props via theming in react-admin. What you show is a material-ui feature for MUI components. This isn't documented anywhere for react-admin, and we won't implement it (as you can create your own derivatives by wrapping a react-admin component).

@davidhenley
Copy link
Contributor Author

Ok thanks

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

No branches or pull requests

2 participants