RocketChat / RocketChat/Rocket.Chat

ContextualbarResizable: Improve resize handler typing and performance

Open
#38,759 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: feature
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:
The onResize handler in ContextualbarResizable currently uses inline type casts and an anonymous function, which can be improved for better readability and performance.

Proposed Improvement:

Extract the resize handler into a named function with explicit ResizeCallback typing.

Wrap the handler in useCallback to prevent unnecessary re-renders of the Resizable component.

Motivation:
Improves type safety and ensures the component follows React best practices by maintaining referential stability for the callback.

Related PR:
#38595

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the ContextualbarResizable component and related PR #38595, focusing on the current onResize handler and its Resizable usage. Done means the handler uses explicit ResizeCallback typing, is named, and has stable callback behavior without changing resizing behavior; run the relevant frontend checks afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.