Reactjs 反应无限滚动组件表体
有没有办法在“表”中使用react无限滚动组件包? 这是我的密码Reactjs 反应无限滚动组件表体,reactjs,infinite-scroll,react-infinite-scroll-component,Reactjs,Infinite Scroll,React Infinite Scroll Component,有没有办法在“表”中使用react无限滚动组件包? 这是我的密码 <table className="table table-sm table-dark table-striped table-hover"> <thead className=""> <tr> <th scope="col">#
<table className="table table-sm table-dark table-striped table-hover">
<thead className="">
<tr>
<th scope="col">#</th>
<th scope="col">Type</th>
<th scope="col">Object</th>
<th scope="col">Url</th>
<th scope="col">Ip</th>
<th scope="col">Detail</th>
</tr>
</thead>
<tbody>
<InfiniteScroll
dataLength={logs.list.length} //This is important field to render the next data
next={fetchData}
hasMore={logs.hasMore}
loader={<h4>Loading...</h4>}
endMessage={
<p style={{ textAlign: "center" }}>
<b>Yay! You have seen it all</b>
</p>
}
>
{logs.list.map((l, i) => {
return (
<tr key={l.id}>
<th scope="row">{l.id}</th>
<td>{l.key}</td>
<td>{l.object}</td>
<td>{l.url}</td>
<td>{l.ip}</td>
<td>----</td>
</tr>
);
})}
</InfiniteScroll>
</tbody>
</table>
#
类型
对象
网址
知识产权
细节
{logs.list.map((l,i)=>{
返回(
{l.id}
{l.key}
{l.object}
{l.url}
{l.ip}
----
);
})}
是的,您只需向外移动
即可包装整个
,而不是将其放在
中。否则,当它呈现加载消息时,将导致无效的DOM嵌套。是的,您只需将
向外移动以包装整个
,而不是将其放在
中。否则,当它呈现加载消息时,您将以无效的DOM嵌套结束。Yes。它正在工作。谢谢,是的。它正在工作。非常感谢。