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

Edit component inside datagrid expansion explicitly requires location property #2804

Closed
kdabir opened this issue Jan 23, 2019 · 1 comment
Closed
Assignees
Labels

Comments

@kdabir
Copy link

kdabir commented Jan 23, 2019

When placed an Edit component inside Datagrid's expand as per the example

const MyExpansion = props => (
    <Edit {...props} title=" " >
...
<Datagrid rowStyle={rowStyle} expand={<MyExpansion/>}>
...

I get the following error:

Uncaught Error: <Edit> component is not properly configured, some essential props are missing.
Be sure to pass the props from the parent. Example:

const MyEdit = props => (
    <Edit {...props}></Edit>
);

The missing props are: location
    at checkMinimumRequiredProps.js:28

This goes away if I add location prop as follows:

<Edit {...props} title=" "  location={props.location}>

The documentation does not mention this, so either this is a bug or docs should be updated (about having to pass location object explicitly).

Environment

  • React-admin version: ^2.6.2
  • Last version that did not exhibit the issue (if applicable): ^2.6.0
  • React version: ^16.7.0
  • Browser: Chrome
  • Stack trace (in case of a JS error):
@fzaninotto
Copy link
Member

Thanks for the bug report. It's a mistake in EditController, I don't think that location is required.

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

No branches or pull requests

2 participants