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

useInfiniteScroll loadMore 不能强制加载更多? #2180

Open
yqz0203 opened this issue Apr 30, 2023 · 7 comments
Open

useInfiniteScroll loadMore 不能强制加载更多? #2180

yqz0203 opened this issue Apr 30, 2023 · 7 comments
Labels
feature New feature or request

Comments

@yqz0203
Copy link

yqz0203 commented Apr 30, 2023

目前isNoMore为false时,调用loadMore会没有效果。

而在某些场景需要强制加载更多数据。

比如时间正序排列的评论列表,当前没有更多数据了。
然后用户提交了一条数据,就需要刷新后面的数据,但是目前来看是不支持的。

@liuyib
Copy link
Collaborator

liuyib commented May 4, 2023

@liuyib liuyib closed this as completed May 4, 2023
@yqz0203
Copy link
Author

yqz0203 commented Jul 23, 2023

@yqz0203 直接用 mutate 方法修改:https://codesandbox.io/s/ahooks-issue-2180-uxc57n?file=/App.tsx:1902-2150

嗯嗯这种是可以的,但是有些场景需要调用接口才能获取实时数据。还有别的方式吗。

@liuyib
Copy link
Collaborator

liuyib commented Jul 23, 2023

嗯嗯这种是可以的,但是有些场景需要调用接口才能获取实时数据。还有别的方式吗。

目前一旦 isNoMore 判定为 true,再滚动到底部也不会触发加载,手动调用 loadMore 也不会再触发加载。

所以如果要实现你的这种情况:

比如时间正序排列的评论列表,当前没有更多数据了。
然后用户提交了一条数据,就需要刷新后面的数据,但是目前来看是不支持的。

估计需要一个 forceLoadMore 的功能,使得即使判定 isNoMore 为 true,也能通过 forceLoadMore 尝试加载更多。是这样吗?@yqz0203

@liuyib liuyib reopened this Jul 23, 2023
@liuyib liuyib added the needs more info Needs more information to continue label Jul 23, 2023
@github-actions
Copy link

Hi, yqz0203.

It seems that this issue is a bit vague and lacks some necessary information.

看起来这条 issue 描述得有些模糊,缺少一些必要的信息。

@yqz0203
Copy link
Author

yqz0203 commented Jul 23, 2023

@liuyib 嗯嗯,是的呢

@liuyib liuyib added feature New feature or request and removed needs more info Needs more information to continue labels Jul 23, 2023
@liuyib
Copy link
Collaborator

liuyib commented Jul 23, 2023

@liuyib 嗯嗯,是的呢

好的,后续考虑下这个能力

@bbb169
Copy link

bbb169 commented Sep 4, 2024

@liuyib @crazylxr 可以帮忙看下这个PR吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants