jingrui 最近的时间轴更新
jingrui
ONLINE

jingrui

V2EX 第 204698 号会员,加入于 2016-12-06 18:54:05 +08:00
今日活跃度排名 6277
jingrui 最近回复了
2 天前
回复了 daochenmeng520 创建的主题 硬件 想买个中手抓握鼠标 500 元内谁最强
M720 家里 3 个,公司 2 个;大小重量价格合适
iOS 开发,你不应该也不能对 xcode 有意见
个人认为:25 年 7 月、26 年 11 月。
很多 javaer 只知道参数是 object ,不会处理 map 对象,菜
22 天前
回复了 w21020 创建的主题 北京 北京换房请教
加杠杆能接收 降价 20% 就可以冲。
7 成是失败,你是不是太乐观了
36 天前
回复了 letterLim 创建的主题 React 请教一个 react native FlatList 的问题
我们还是用的 FlashList ,滚动到指定消息 很难优化


const firstScrollRef = useRef(false);

function scrollToMsg(msgID){
let index = viewMessages.findIndex((value)=>value?.msgID === msgID)
if (index <= 0) index = 1;
console.log('scrollToMsg', index, msgID, viewMessages.length);
flatListRef.current.scrollToIndex({ index:index-1, animated: true });
}

const scrollToBottom = useCallback(
debounce(() => {
if (flatListRef.current) {
console.log('scrollToBottom', firstScrollRef.current, from, msgID)
IMSdk.readConversation(uid)
if (!firstScrollRef.current) {
if (from === 'history' && msgID) {
scrollToMsg(msgID)
} else {
flatListRef.current.scrollToEnd({ animated: true });
}
firstScrollRef.current = true
} else {
flatListRef.current.scrollToEnd({ animated: true });
}
}
}, 200), // 延迟时间可以根据需要调整
[from, msgID]
);
37 天前
回复了 Leoking222 创建的主题 macOS todoList 推荐
notion ,这个任务记录模板,好使的很
37 天前
回复了 lmshl 创建的主题 生活 🎉小棉袄出生, 生殖隔离已打破
恭喜恭喜恭喜恭喜恭喜恭喜恭喜恭喜恭喜恭喜
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3481 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 04:38 · PVG 12:38 · LAX 21:38 · JFK 00:38
Developed with CodeLauncher
♥ Do have faith in what you're doing.