close
Skip to content

BaseControl: Update Prop docs#70064

Open
Mayank-Tripathi32 wants to merge 3 commits intoWordPress:trunkfrom
Mayank-Tripathi32:try/fix-BaseControl-Prop-docs
Open

BaseControl: Update Prop docs#70064
Mayank-Tripathi32 wants to merge 3 commits intoWordPress:trunkfrom
Mayank-Tripathi32:try/fix-BaseControl-Prop-docs

Conversation

@Mayank-Tripathi32
Copy link
Copy Markdown
Member

@Mayank-Tripathi32 Mayank-Tripathi32 commented May 6, 2025

Fixes #70063

What?

Closes #70063

This PR fixes the documentation for the BaseControl component to clarify that it doesn't support the as prop, while its VisualLabel subcomponent does.

Why?

The prop docs for the BaseControl component incorrectly suggested that it takes an as prop due to the prop type definition. However, in reality, the as prop is not passed down to the internal wrapper component. This PR updates the documentation to correctly reflect the component's behavior.

How?

  • Fixed type in the BaseControl component and regenerated the README.md
  • Added an entry in the CHANGELOG.md file to document this documentation fix

Testing Instructions

  1. Check the updated type in packages/components/src/base-control/index.tsx
  2. Verify that the CHANGELOG.md entry correctly describes the fix
  3. After the documentation is regenerated, verify that the BaseControl component's README.md correctly states that it doesn't support the as prop

Testing Instructions for Keyboard

Not applicable as this is a documentation-only change.

Screenshots or screencast

Not applicable as this is a documentation-only change.

@Mayank-Tripathi32 Mayank-Tripathi32 force-pushed the try/fix-BaseControl-Prop-docs branch from a783637 to a31a15d Compare May 6, 2025 12:11
@Infinite-Null
Copy link
Copy Markdown
Contributor

Infinite-Null commented May 6, 2025

Hi @Mayank-Tripathi32, I looked into this and ran the build script on trunk everything seems to work well, Then I checkout into your PR and ran the build command it failed and failed specifically on type build then I remove your type change back to props: WordPressComponentProps< BaseControlProps, null >, The build was successful.

I think the Build is failing because of the type change in your PR.

@Mamaduka Mamaduka marked this pull request as ready for review May 7, 2025 07:50
@Mamaduka Mamaduka requested a review from ajitbohra as a code owner May 7, 2025 07:50
@github-actions
Copy link
Copy Markdown

github-actions bot commented May 7, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mayank-Tripathi32 <mayanktripathi32@git.wordpress.org>
Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 7, 2025

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BaseControl: Prop docs says it's polymorphic but it's not

3 participants