-
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
Primitives: Add types #21482
Primitives: Add types #21482
Conversation
Size Change: -12 B (0%) Total Size: 903 kB
ℹ️ View Unchanged
|
1236a5a
to
1de5d3a
Compare
Snaphots have changed, I'll update. |
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.
Looks good, thanks!
'aria-hidden': true, | ||
focusable: false, |
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.
The React declarations require this change, these props are typed as booleans. I checked in a code sandbox and the following confirms this should produce the same HTML.
This JSX:
<>
<svg aria-hidden="true" focusable="false" />
<svg aria-hidden={ true } focusable={ false } />
</>
Produces this HTML:
<svg aria-hidden="true" focusable="false"></svg>
<svg aria-hidden="true" focusable="false"></svg>
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.
Thanks for checking!
"declarationDir": "build-types" | ||
}, | ||
"include": [ "src/**/*" ], | ||
"references": [ { "path": "../element" } ] |
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.
That's the only project reference we need 👍
gutenberg/packages/primitives/package.json
Lines 27 to 29 in 7539780
"@babel/runtime": "^7.9.2", | |
"@wordpress/element": "file:../element", | |
"classnames": "^2.2.5" |
Thanks Jon! I forgot to add a Changelog entry, will do now. |
I made one mistake, |
Includes a fix to `@wordpress/primitives` to make `SVG`'s `isPressed` prop optional (oversight in #21482).
Description
Add types to
@wordpress/primitives
.Taking notes from #21248. Part of #18838.
How has this been tested?
Types of changes
Add types.
Checklist:
cc/ @sirreal