<Virtuoso
ref={virt}
style={{ width: '100%', height: '100%' }}
totalCount={GlobalState.messages.length}
item={index => <MessageRow index={index} />}
initialItemCount={20}
endReached={async () => {
// await API.get('messages', { chatid: sc['id'] , offset : ++page }).then(msgs => {
// GlobalState.messages = (msgs.data as any[]).concat(GlobalState.messages);
// })
}}
/>
上面是用于在聊天页面上显示react-virtuoso组件的代码。我想启用列表中的“加载以前的消息”功能。我该怎么做。