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

feat: refactor fn #244

Closed

Conversation

crazyair
Copy link
Contributor

@crazyair crazyair commented May 9, 2022

No description provided.

@vercel
Copy link

vercel bot commented May 9, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
drawer ✅ Ready (Inspect) Visit Preview May 9, 2022 at 6:15AM (UTC)

@crazyair crazyair changed the title feat: 同步代码 feat: refactor fn May 9, 2022
@codecov
Copy link

codecov bot commented May 9, 2022

Codecov Report

Merging #244 (7ed8e93) into master (133fd21) will decrease coverage by 0.39%.
The diff coverage is 78.53%.

❗ Current head 7ed8e93 differs from pull request most recent head a06c31a. Consider uploading reports for the commit a06c31a to get more accurate results

@@            Coverage Diff             @@
##           master     #244      +/-   ##
==========================================
- Coverage   73.97%   73.58%   -0.40%     
==========================================
  Files           3        3              
  Lines         392      371      -21     
  Branches      160      159       -1     
==========================================
- Hits          290      273      -17     
+ Misses        102       98       -4     
Impacted Files Coverage Δ
src/DrawerChild.tsx 69.58% <75.00%> (-0.70%) ⬇️
src/utils.ts 80.55% <83.33%> (+0.25%) ⬆️
src/DrawerWrapper.tsx 88.88% <93.54%> (-1.12%) ⬇️

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

const maskDom = useRef<HTMLDivElement>(null);
const handlerDom = useRef<HTMLDivElement>(null);
const drawerId = useRef<string>();
const startPos = useRef<Point>(null);
Copy link
Member

Choose a reason for hiding this comment

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

hmm...这些 useRef 可以改成 useState 不?纯改成 useRef 就没有 FC 的优势了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

目前单纯改写法, 看看后面用 rc-motion 重构还需不需要这些变量吧

@crazyair crazyair requested a review from zombieJ May 9, 2022 06:56
};
const childProps = omit({ ...defaultProps, ...props }, [
Copy link
Member

Choose a reason for hiding this comment

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

这个需要挪到上面去,props 本身就通过解构合并起来。否则重构很容易采坑

@crazyair crazyair closed this Dec 26, 2023
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.

None yet

2 participants