Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance: cache children to improve performance #426

Merged
merged 1 commit into from
Apr 18, 2022
Merged

performance: cache children to improve performance #426

merged 1 commit into from
Apr 18, 2022

Conversation

KAROTT7
Copy link
Contributor

@KAROTT7 KAROTT7 commented Dec 17, 2021

Improve performance via cache

relate: ant-design/ant-design#32681

src/Menu.tsx Outdated
Comment on lines 190 to 192
const childList: React.ReactElement[] = React.useMemo(() => {
return parseChildren(children, EMPTY_LIST);
}, [children]);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const childList: React.ReactElement[] = React.useMemo(() => {
return parseChildren(children, EMPTY_LIST);
}, [children]);
const childList: React.ReactElement[] = React.useMemo(() => parseChildren(children, EMPTY_LIST), [children]);

@codecov
Copy link

codecov bot commented Dec 17, 2021

Codecov Report

Merging #426 (5e5bf02) into master (700ce5c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #426   +/-   ##
=======================================
  Coverage   99.85%   99.85%           
=======================================
  Files          25       25           
  Lines         674      675    +1     
  Branches      175      175           
=======================================
+ Hits          673      674    +1     
  Misses          1        1           
Impacted Files Coverage Δ
src/Menu.tsx 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@afc163
Copy link
Member

afc163 commented Dec 17, 2021

@zombieJ 看看

@zombieJ zombieJ merged commit 5e607ff into react-component:master Apr 18, 2022
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.

3 participants