Skip to content

Document prop merging conventions - #8248

Draft
joshblack with Copilot wants to merge 4 commits into
mainfrom
copilot/update-style-docs-prop-merging
Draft

Document prop merging conventions#8248
joshblack with Copilot wants to merge 4 commits into
mainfrom
copilot/update-style-docs-prop-merging

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Defines consistent precedence when components and consumers provide the same prop.

Changelog

New

  • Guidance for merging event handlers, class names, styles, and attributes.
  • Examples for consumer overrides and component-owned attributes.
<button
  {...rest}
  className={clsx(classes.Example, className)}
  style={{...defaultStyle, ...style}}
/>

Changed

  • None.

Removed

  • None.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; documentation-only change

Testing & Reviewing

  • Review the documented precedence rules and examples for clarity and consistency.

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7967c1b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@joshblack joshblack added the skip changeset This change does not need a changelog label Jul 28, 2026 — with Copilot SWE Agent
Copilot AI requested a review from joshblack July 28, 2026 20:14

@joshblack joshblack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add the mergeProps.ts utility from: https://github.com/primer/react/pull/8168/changes#diff-b21bbbcb2674bcbc6f8e205e1c9223efea602c2abea46bb150c1d34b8ee06d07 and include tests for it. Also add an ADR for prop merging conventions for me with this decision. Highlight any scenarios that I should be aware of that aren't included already

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@copilot add the mergeProps.ts utility from: https://github.com/primer/react/pull/8168/changes#diff-b21bbbcb2674bcbc6f8e205e1c9223efea602c2abea46bb150c1d34b8ee06d07 and include tests for it. Also add ...

Implemented in ba4584c. Added mergeProps with tests, ADR-025, and updated the style guide to use the utility. The ADR highlights refs, shallow style merging, defaultPrevented/stopPropagation, synchronous one-way cancellation, thrown errors, on* callback detection, zero- and multi-argument callbacks, and explicit undefined precedence.

Copilot AI requested a review from joshblack July 28, 2026 21:23
@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

Comment thread contributor-docs/style.md Outdated
}
```

See [ADR-025](./adrs/adr-025-prop-merging.md) for the full decision and

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove this line, don't refer to ADRs as the style guide here should be the reference for everything moving forward

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the ADR reference in 3254e14 so the style guide stands on its own.

Comment on lines +9 to +10
| Status | Accepted ✅ |
| Implementation | Adopted ✅ |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot this is currently proposed and not adopted

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated ADR-025 to Proposed ⚠️ with implementation Pending ⚠️ in 7967c1b.

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants