Skip to content

Error component typescript and doc issue #10580

@smeng9

Description

@smeng9

What you were expecting:

The error component props typing should match exactly as docs

What happened instead:

After some review I found out they are not exactly the same.
The error component for Admin and Layout receives different arguments, but the docs are not very clear.

The error component on layout https://marmelab.com/react-admin/Layout.html#error says I will receive resetErrorBoundary but the user passed in error component did not receive such prop https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/layout/Error.tsx#L47

The typescript ErrorProps also only picks "error" from react-error-boundry FallbackProps, but not the resetErrorBoundary https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/layout/Error.tsx#L137

We should standardize these components. The ErrorProps interface on Admin component is also not published

Environment

  • React-admin version: 5.6.3
  • Last version that did not exhibit the issue (if applicable): N/A
  • React version: 19.0.0
  • Browser: Safari
  • Stack trace (in case of a JS error):

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions