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

TabsProps has "id" as required, but is not required in component usage #6899

Open
bvandercar-vt opened this issue Jul 8, 2024 · 1 comment · May be fixed by #6900
Open

TabsProps has "id" as required, but is not required in component usage #6899

bvandercar-vt opened this issue Jul 8, 2024 · 1 comment · May be fixed by #6900

Comments

@bvandercar-vt
Copy link
Contributor

bvandercar-vt commented Jul 8, 2024

TabsProps id prop is required, but somewhere this gets changed to optional:

image

image

I think this has to do with the usage of React.PureComponent in AbstractPureComponent, it seems this changes all properties to optional, which could lead to major issues.

At somepoint, all component classes should probably be migrated to functions, per React's reccomendation: https://react.dev/reference/react/PureComponent#alternatives

@bvandercar-vt bvandercar-vt linked a pull request Jul 8, 2024 that will close this issue
@bvandercar-vt
Copy link
Contributor Author

bvandercar-vt commented Jul 8, 2024

I think this has to do with the usage of React.PureComponent in AbstractPureComponent

Actually, it is due to assigning the type of defaultProps in a class component-- Setting the type of defaultProps to Partial makes the props of the component all partial, so that's a no-go. We can still use satisfies to check the type.

PR to fix: #6900

Still, this would be fixed if all class components get converted to function components.

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

Successfully merging a pull request may close this issue.

1 participant