Comments (2)
因为形成了闭包,导致获取不到新的 props,可以通过 useRef 的方式处理一下
from nutui-react.
const ref = useRef(props)
useEffect(() => {
ref.current = props
}, [props])
const loadMore = (done: () => void) => {
setTimeout(() => {
console.log('loadmore',ref.current)
const curLen = defultList.length
for (let i = curLen; i < curLen + 10; i++) {
defultList.push(`${i}`)
}
if (defultList.length >= 30) {
setHasMore(false)
} else {
setDefultList([...defultList])
}
done()
}, 500)
}
from nutui-react.
Related Issues (20)
- Form表单里面使用Picker HOT 2
- Address/Cascader 选择第一列之后,第二列不显示
- taro h5 Tabs 切换 tab,tab 标签会滚动到初始位置 HOT 1
- Tabs: 选项卡 Demo:数量多,滚动操作在微信模拟器不生效 HOT 2
- [FR]: 2.3.+版本的UI是否需要走查一遍?很多细节不太符合直觉,对比旧版本和nutui vue版本也有所不同 HOT 4
- [FR]: FomItem支持form.getFieldValue('xxx')判断来控制是否渲染吗 HOT 1
- [FR]: Tabbar用法是否有问题?handleClick事件不生效,而且只能传idx(number)类型,限制的太窄 HOT 1
- Button:自定义主题后,danger Button 颜色不正确 HOT 7
- [FR]: 希望能够开发一些业务组件类似于NutUI-Biz里面的组件。 HOT 7
- 2.3.3 微信小程序 DatePicker 只渲染为一个数字“0” HOT 1
- primary 按钮的颜色通过css变量设置无效,通过ConfigProvider才有效 HOT 5
- VirtualList 虚拟列表闪屏&多次触发onScroll&快滚动存在空白
- 升级至v2.3.3后 <DatePicker /> 渲染为一个'0' HOT 1
- export 'RectDown' (imported as 'RectDown') was not found in '@nutui/icons-react-taro' HOT 2
- [FR]: Range 组件的 marks 是 Record<string, unknow> 类型,而内部实际只用到了其 keys,期望简化成 Array类型,或者将 values 也利用起来
- picker的渲染有错误 HOT 1
- InfiniteLoading 已经将hasMore设置为false下拉到最后依然显示加载中 HOT 1
- tabs 初始化显示非第一个 tab 页,有明显的动画切换 HOT 1
- 编译成钉钉小程序(nutui v2),组件内含有icon的组件都报错 HOT 10
- [FR]: InfiniteLoading 指定滚动位置 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nutui-react.