Skip to content

refactor(uikit-playground): remove unnecessary ReactElement type annotations from components#40813

Merged
tassoevan merged 1 commit into
developfrom
refactor/prepare-types-for-react-19-11
Jun 9, 2026
Merged

refactor(uikit-playground): remove unnecessary ReactElement type annotations from components#40813
tassoevan merged 1 commit into
developfrom
refactor/prepare-types-for-react-19-11

Conversation

@tassoevan

@tassoevan tassoevan commented Jun 4, 2026

Copy link
Copy Markdown
Member

⚠️ This is part 11/23 of #40796. PR for refactor/prepare-types-for-react-19-10 must be merged first.


Proposed changes (including videos or screenshots)

As a first step towards upgrading to React 19, it handles types from @types/react looking forward the next major.

Issue(s)

Task: ARCH-2170

Steps to test or reproduce

Further comments

No runtime change is expected from it.

Summary by CodeRabbit

  • Refactor
    • Updated TypeScript type annotations across UI components for improved type consistency and import optimization. All component behavior and rendering remain unchanged.

@changeset-bot

changeset-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2cb31d0

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

@coderabbitai

coderabbitai Bot commented Jun 4, 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b2d22e5b-0955-4e58-a23f-5c7577a03ad3

📥 Commits

Reviewing files that changed from the base of the PR and between 7cca5d9 and 2cb31d0.

📒 Files selected for processing (6)
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/BurgerIcon.tsx
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/Line.tsx
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/Wrapper.tsx
  • apps/uikit-playground/src/Components/Preview/Display/UiKitElementWrapper/UiKitElementWrapper.tsx
  • apps/uikit-playground/src/Components/navMenu/Menu/Wrapper.tsx
  • apps/uikit-playground/src/Context/createCtx.tsx
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/uikit-playground/src/Components/navMenu/Menu/Wrapper.tsx
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/BurgerIcon.tsx
  • apps/uikit-playground/src/Components/Preview/Display/UiKitElementWrapper/UiKitElementWrapper.tsx
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/Wrapper.tsx
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/Line.tsx
  • apps/uikit-playground/src/Context/createCtx.tsx
🧠 Learnings (2)
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/uikit-playground/src/Components/navMenu/Menu/Wrapper.tsx
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/BurgerIcon.tsx
  • apps/uikit-playground/src/Components/Preview/Display/UiKitElementWrapper/UiKitElementWrapper.tsx
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/Wrapper.tsx
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/Line.tsx
  • apps/uikit-playground/src/Context/createCtx.tsx
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/uikit-playground/src/Components/navMenu/Menu/Wrapper.tsx
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/BurgerIcon.tsx
  • apps/uikit-playground/src/Components/Preview/Display/UiKitElementWrapper/UiKitElementWrapper.tsx
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/Wrapper.tsx
  • apps/uikit-playground/src/Components/NavBar/BurgerIcon/Line.tsx
  • apps/uikit-playground/src/Context/createCtx.tsx
🔇 Additional comments (6)
apps/uikit-playground/src/Components/NavBar/BurgerIcon/BurgerIcon.tsx (1)

2-2: LGTM!

Also applies to: 9-9

apps/uikit-playground/src/Components/NavBar/BurgerIcon/Line.tsx (1)

4-4: LGTM!

apps/uikit-playground/src/Components/NavBar/BurgerIcon/Wrapper.tsx (1)

3-3: LGTM!

Also applies to: 5-5

apps/uikit-playground/src/Context/createCtx.tsx (1)

1-1: LGTM!

Also applies to: 12-12

apps/uikit-playground/src/Components/Preview/Display/UiKitElementWrapper/UiKitElementWrapper.tsx (1)

3-5: LGTM!

apps/uikit-playground/src/Components/navMenu/Menu/Wrapper.tsx (1)

2-4: LGTM!


Walkthrough

The PR removes explicit ReactElement return type annotations from six React components across the uikit-playground app. Import statements are updated to use ReactNode as a type-only import where children props are typed. No runtime logic or rendered output changes.

Changes

React component type refactoring

Layer / File(s) Summary
BurgerIcon component family type updates
apps/uikit-playground/src/Components/NavBar/BurgerIcon/BurgerIcon.tsx, apps/uikit-playground/src/Components/NavBar/BurgerIcon/Line.tsx, apps/uikit-playground/src/Components/NavBar/BurgerIcon/Wrapper.tsx
The BurgerIcon, Line, and Wrapper components remove explicit ReactElement return type annotations and use ReactNode as a type-only import for children props.
UI wrapper and container components
apps/uikit-playground/src/Components/Preview/Display/UiKitElementWrapper/UiKitElementWrapper.tsx, apps/uikit-playground/src/Components/navMenu/Menu/Wrapper.tsx
ElementWrapper and Wrapper components in different contexts remove explicit ReactElement return types, with ReactNode imported as a type-only import.
Context provider children type update
apps/uikit-playground/src/Context/createCtx.tsx
The createCtx factory function updates the returned Provider component's children prop type from ReactElement to ReactNode, with the React import updated to ReactNode type-only.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • RocketChat/Rocket.Chat#40808: Both PRs remove explicit : ReactElement return-type annotations from React functional components and adjust React imports to use ReactNode as a type-only import.
  • RocketChat/Rocket.Chat#40807: Both PRs perform the same TypeScript refactor by removing explicit ReactElement return type annotations in React components, leaving runtime structure unchanged.
  • RocketChat/Rocket.Chat#40809: Both PRs remove explicit ReactElement return type annotations and related imports in React functional components to rely on inferred return types.

Suggested labels

type: chore

Suggested reviewers

  • ggazzo
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately and specifically describes the main change: removing unnecessary ReactElement type annotations from uikit-playground components.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • REACT-19: Request failed with status code 401
  • ARCH-2170: Request failed with status code 401

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 and usage tips.

@dionisio-bot

dionisio-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.16%. Comparing base (7cca5d9) to head (2cb31d0).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40813      +/-   ##
===========================================
- Coverage    70.18%   70.16%   -0.03%     
===========================================
  Files         3340     3340              
  Lines       123638   123638              
  Branches     22029    22058      +29     
===========================================
- Hits         86781    86746      -35     
- Misses       33514    33542      +28     
- Partials      3343     3350       +7     
Flag Coverage Δ
e2e 59.36% <ø> (-0.03%) ⬇️
e2e-api 47.16% <ø> (+0.02%) ⬆️
unit 70.97% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tassoevan tassoevan force-pushed the refactor/prepare-types-for-react-19-11 branch from 21cbb9a to 2cb31d0 Compare June 9, 2026 01:45
@tassoevan tassoevan added this to the 8.6.0 milestone Jun 9, 2026
@tassoevan tassoevan requested a review from a team June 9, 2026 01:45
@tassoevan tassoevan marked this pull request as ready for review June 9, 2026 01:46

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 6 files

Re-trigger cubic

@tassoevan tassoevan added the stat: QA assured Means it has been tested and approved by a company insider label Jun 9, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 9, 2026
@tassoevan tassoevan added this pull request to the merge queue Jun 9, 2026
Merged via the queue into develop with commit 918abe1 Jun 9, 2026
48 checks passed
@tassoevan tassoevan deleted the refactor/prepare-types-for-react-19-11 branch June 9, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants