Components: Change types export to declaration file#72979
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 2.45 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 850a6e3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19078129551
|
youknowriad
left a comment
There was a problem hiding this comment.
Works for me. I don't have strong opinions on how we expose the types.
I like the ComponentProps typeof trick.
What?
Updates components package to point to type declaration file and avoid exposing full
build-typespath, revising existing usage to useReact.ComponentPropsto extract props of an exported component from@wordpress/components.Follow-up to #72809
Alternative to #72831
Why?
exportsis to be intentionally explicit about exposed paths, where the current usage allows arbitrary subpath exportsHow?
@wordpress/componentstypesintroduced in Routing: Add boot package #72809build-types/to useReact.ComponentPropsTesting Instructions
Build should pass.