ControlWithError: Add docs about cloned children#71392
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. |
|
Flaky tests detected in 4b6f8f4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17307737882
|
What?
Adds documentation to the
ControlWithErrorcomponent explaining how it handles clonedchildren.Why?
The
ControlWithErrorcomponent clones its child element to inject enhanced props, but this behavior wasn't documented. This is important because certain behavior will not work if the root-level component ofchildrendoesn't handle these injected props (for example if there's a wrapper div around the main control that doesn't forward the necessary props — which happened in #71350 (comment)).