-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
withFallbackStyles: Convert to TypeScript #48720
Conversation
constructor( props: Props ) { | ||
super( props ); |
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.
This change addresses the prefer-rest-params
lint error. Runtime behavior should be the same.
Size Change: +3 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
Flaky tests detected in 3efa8b1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4322535805
|
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.
LGTM 🚀
Optional improvement: (feel free to ignore or to just apply partially, given the very low usage of this HOC)
It would be good to somewhat indicate that the type of the return value of mapNodeToProps
is the same as the fallbackStyles
state, and that the type of Props['node']
is the same type of the node
argument in mapNodeToProps
.
I took a look at definitely typed defs, maybe we could borrow inspiration from those?
Part of #35744
What?
Convert the
withFallbackStyles
HOC to TypeScript.Why?
It isn't really necessary that these HOCs are typed at this point, but just converting them because they are pretty simple. We can
ts-nocheck
any of the ones that are not worthwhile.Testing Instructions
✅ Static checks pass.