Skip to content

fix: hoist static InfoLabel JSX to module scope#10547

Open
Pravinath wants to merge 1 commit into
wso2:masterfrom
Pravinath:fix-27948-hoist-static-jsx
Open

fix: hoist static InfoLabel JSX to module scope#10547
Pravinath wants to merge 1 commit into
wso2:masterfrom
Pravinath:fix-27948-hoist-static-jsx

Conversation

@Pravinath

Copy link
Copy Markdown

Purpose

This PR addresses the React Doctor warning about hoisting static JSX out of the render path.

Previously, the InfoLabel JSX element was recreated every time resolvePopupContent() was called. This change moves the static JSX to module scope and reuses it, avoiding unnecessary JSX recreation without changing the existing behavior.

Related Issues

Related PRs

  • N/A

Checklist

  • e2e cypress tests locally verified. (for internal contributers)
  • Manual test round performed and verified.
  • UX/UI review done on the final implementation.
  • Documentation provided. (Add links if there are any)
  • Relevant backend changes deployed and verified
  • Unit tests provided.
  • Integration tests provided.

Security checks

Developer Checklist (Mandatory)

  • Complete the Developer Checklist in the related product-is issue to track any behavioral change or migration impact.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 8075847c-3276-4a63-8057-5f13408596e6

📥 Commits

Reviewing files that changed from the base of the PR and between e2a0039 and ee34cf6.

📒 Files selected for processing (1)
  • features/admin.applications.v1/components/settings/sign-on-methods/step-based-flow/authenticators.tsx

📝 Walkthrough

Walkthrough

Changes

Authenticator popup label reuse

Layer / File(s) Summary
Shared info label rendering
features/admin.applications.v1/components/settings/sign-on-methods/step-based-flow/authenticators.tsx
Defines the static INFO_LABEL at module scope and uses it across resolvePopupContent branches instead of a function-local JSX constant.

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Changeset Required ❌ Error PR changes only features/.../authenticators.tsx; no new .changeset/*.md appears in the commit diff, so a changeset is missing. Add a new .changeset/*.md entry for this feature change, listing the impacted package(s) and the correct version bump; .changeset/README.md doesn't count.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: hoisting the static InfoLabel JSX to module scope.
Description check ✅ Passed The description covers purpose, related issue, related PRs, checklist, security checks, and developer checklist sections.
Linked Issues check ✅ Passed The PR matches issue #27948 by hoisting the static InfoLabel JSX out of the render path to module scope.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to the requested JSX hoist refactor and introduces no unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ create changeset

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[React Doctor] rendering-hoist-jsx: Static JSX "InfoLabel" inside a component — hoist to module scope so it isn't... (1 occurrence)

1 participant