Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bear with me as I'm doing this from my phone, but I don't see
PropsWithRef
defined anywhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah - that's totally my miss. I'm still trying to figure out problems with other MUI components on another branch and didn't see that I'd missed copying the type here. Unfortunately, after copying, it doesn't appear to resolve the issue. I'll keep digging. Sorry for that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After further investigation, I think this change + the types/react PropsWithRef definition does fix the original issue.
However, it also revealed a related problem: several MUI component props refer to React types that are not currently supported by compat (e.g. React.InputHTMLAttributes). The simple fix would be to alias those to HTMLAttributes, which captures all valid HTML attributes already (per #4202). A more React-y way would be to add React's stricter tag-based props there's quite a lot of them and it this seems like a big change in typing complexity over the current state.
@rschristian do you have a preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aliasing to the looser HTMLAttributes sounds fine for the time being, if you're willing.
Indeed, supporting all of those per-tag attributes would be a PITA, though (eventually) desirable I guess.