Skip to content

feat: change createRef to useRef#2932

Merged
winjo merged 1 commit intomainfrom
fix/use-ref
Sep 6, 2023
Merged

feat: change createRef to useRef#2932
winjo merged 1 commit intomainfrom
fix/use-ref

Conversation

@winjo
Copy link
Copy Markdown
Contributor

@winjo winjo commented Jul 24, 2023

Types

  • 💄 Code Style Changes

Background or solution

🤖 Generated by Copilot at b4caffc

  • Replaced createRef with useRef in several components to avoid creating new refs on every render and to be consistent with the React hooks style (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Removed unused createRef imports from RecycleTree.tsx, extension-tree-view.tsx, markers-tree.view.tsx, outline.tsx, and search.view.tsx (link, link, link, link, link)
  • Added useRef imports to opened-editor.tsx and output.view.tsx where it was used (link, link)

close #2899

Changelog

🤖 Generated by Copilot at b4caffc

This pull request refactors various components in the opensumi/core repository to use the useRef hook instead of the createRef function for creating and accessing refs. This improves performance, readability, and consistency of the code. The pull request also removes some unused imports and adds a missing one.

@winjo winjo requested a review from Ricbet July 24, 2023 10:51
@opensumi opensumi Bot added 🎨 feature feature required ⚙️ refactor Refactor code 💄 style change labels Jul 24, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 24, 2023

Codecov Report

Patch has no changes to coverable lines.

📢 Thoughts on this report? Let us know!.

@erha19
Copy link
Copy Markdown
Member

erha19 commented Aug 16, 2023

@winjo 冲突处理一下

@winjo winjo merged commit f9dc4f4 into main Sep 6, 2023
@winjo winjo deleted the fix/use-ref branch September 6, 2023 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] React 函数组件里有不少使用了 createRef API, 应使用 useRef

3 participants