Closed zxh0125 closed 1 year ago
有可能是第一次调用 loadMore
后,高度还是不够,所以调用了第二次
具体的可以来个复现 demo, codesandbox or stackblitz.
Hi, zxh0125.
Please provide a online reproduction so that we can help you troubleshoot the problem. You can create a demo by codesandbox or stackblitz.
我们需要你提供一个在线的重现实例,以便于我们帮你排查问题。你可以通过 codesandbox 或 stackblitz 创建一个实例。
我也有同样的问题,不是调用两次啊,如果高度不够一致调,可怎么处理
有可能是第一次调用
loadMore
后,高度还是不够,所以调用了第二次具体的可以来个复现 demo, codesandbox or stackblitz.
你后来怎么解决的呢
Hi, zxh0125.
Please provide a online reproduction so that we can help you troubleshoot the problem. You can create a demo by codesandbox or stackblitz.
我们需要你提供一个在线的重现实例,以便于我们帮你排查问题。你可以通过 codesandbox 或 stackblitz 创建一个实例。
把你们官网的demo1, setData([1]).就复现了,因为一直触发源码中的useEffect
Version of antd-mobile
5.28.0
Operating system and its version
Others
Browser and its version
微信
Sandbox to reproduce
No response
What happened?
/*
import styles from './index.less' import ListItem from './ListItem'
import { getOrders } from '@/services/order' import type { ISaveOrderRes } from '@/types/sale/sumbitOrder'
let count = 0
export async function mockRequest() { if (count >= 5) { return [] } await sleep(2000) count++ return [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', ] }
export default memo(function Me() { const offset = 0 const limit = 4
const [hasMore, setHasMore] = useState(true)
// const [offset, setOffset] = useState(0) // const [limit, setLimit] = useState(10)
const [orderData, setOrderData] = useState<ISaveOrderRes[]>([])
// const getOrders=()=>{
// }
const loadMore = async () => { count++
}
const goDetail = (id: string) => { history.push(
/purchasedetail/${id}
) } return () })
Relevant log output
No response