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

Tab component Type Definition is incorrect #5334

Closed
martdavidson opened this issue Oct 1, 2020 · 1 comment · Fixed by #5342
Closed

Tab component Type Definition is incorrect #5334

martdavidson opened this issue Oct 1, 2020 · 1 comment · Fixed by #5342
Assignees
Labels

Comments

@martdavidson
Copy link

What you were expecting:
Should be able to use <Tab label="summary"> as shown in the documentation.

What happened instead:
Looks like all the possible Tab props are required:

TS2740: Type '{ children: Element[]; label: string; }' is missing the following properties from type '{ [x: string]: any; basePath: any; children: any; contentClassName: any; context: any; className: any; icon: any; label: any; record: any; resource: any; value: any; }': basePath, contentClassName, context, className, and 4 more.

Also, it would be nice if that list of props was available as an exported TabProp interface.

Steps to reproduce:
Try creating the TabbedShowLayout example from the docs, should be enough to show the issue.

  • React-admin version: 3.9.0-beta.3
  • React version: 16.13.1
@fzaninotto
Copy link
Member

Thanks for the report. We haven't converted Tab to TypeScript yet, so TypeScript falls back to inference from PropTypes, which is wrong in that case.

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

Successfully merging a pull request may close this issue.

2 participants