-
Notifications
You must be signed in to change notification settings - Fork 66
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(list): add list component #463
base: develop
Are you sure you want to change the base?
Conversation
冲突了,先合并develop 处理冲突 |
src/list/list.tsx
Outdated
useEffect(() => { | ||
const scorllParent = getScrollParent(root.current) | ||
|
||
scorllParent.addEventListener('scroll', handleScroll); | ||
return () => { | ||
removeEventListener('scroll', handleScroll) | ||
} | ||
}, [height, handleScroll]) | ||
|
||
return ( | ||
<div ref={root} className={`${name}-list`} onScroll={(e)=>handleScroll(e)}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
监听onScroll
,root
是同一个,重复监听一个地方了
} | ||
|
||
const List: React.FC<ListProps> = (props) => { | ||
const { classPrefix } = useConfig(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里可以使用usePrefixClass hooks,可以看看其他组件的写法
@@ -0,0 +1,12 @@ | |||
import { useState } from 'react'; | |||
|
|||
const useWindowHeight = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以前的hooks的写法就有问题,你要么直接使用ahooks里的useSize好了,这个hooks删掉?
fix #394
🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
任务清单
📝 更新日志
fix(组件名称): 处理问题或特性描述 ...
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单