Skip to content

[all components] Fix render prop warning false positive#4363

Merged
atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/fix-render-prop-warning-4361
Mar 18, 2026
Merged

[all components] Fix render prop warning false positive#4363
atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/fix-render-prop-warning-4361

Conversation

@atomiks

@atomiks atomiks commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #4361

Summary

This narrows the development-only render prop warning so constant-style callbacks such as DEFAULT_RENDER no longer trigger a false positive. The warning still catches component-like names, including PascalCase names with acronym prefixes.

Changes

  • Require warned render callback names to look component-like instead of matching uppercase constants.
  • Add regression coverage for screaming snake case callbacks.
  • Keep warning coverage for standard PascalCase and acronym-prefixed component names.

@atomiks atomiks added type: regression A bug, but worse, it used to behave as expected. scope: all components Widespread work has an impact on almost all components. hook: useRender labels Mar 17, 2026
@atomiks

atomiks commented Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

Codex Review

Overview

This patch narrows the render prop warning so uppercase constant callbacks like DEFAULT_RENDER stop warning while component-like names still do. The tests cover the false-positive case and preserve the earlier warning behavior for PascalCase and acronym-prefixed component names.

Findings (None)

No blocking issues found in this patch.

Confidence: 4/5

High confidence based on a full pass over the branch diff, targeted inspection of the warning heuristic and regression tests, and successful runs of pnpm test:jsdom useRenderElement --no-watch plus targeted ESLint on the touched files.

Notes

  • Reviewed the full upstream/master...HEAD diff.
  • No additional accessibility, API, maintainability, or performance concerns surfaced for this small change set.

@pkg-pr-new

pkg-pr-new Bot commented Mar 17, 2026

Copy link
Copy Markdown

commit: fa89603

@mui-bot

mui-bot commented Mar 17, 2026

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Mar 17, 2026

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit fa89603
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69ba75d29ce8f700086202df
😎 Deploy Preview https://deploy-preview-4363--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@atomiks atomiks marked this pull request as ready for review March 17, 2026 23:15
@atomiks atomiks merged commit 0c5940d into mui:master Mar 18, 2026
22 of 23 checks passed
@atomiks atomiks deleted the codex/fix-render-prop-warning-4361 branch March 18, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hook: useRender scope: all components Widespread work has an impact on almost all components. type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Render prop warning false positive on screaming snake case variables

2 participants