You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
proTable实现 show 和order时,比如切换show ,流程是: 通过columns来找到正确的colKey ,再去修改出新的columnsState ,再修改columnsState,再useMemo 计算出table Columns ,我感觉代码会比较绕。
请问一下,为什么不派生出tableColumns状态,比如 useEffect 监听columns,一旦变了,就把 order show挂在上面,set到一个本地状态上。这就是派生。这样以后修改,直接修改这个columns上的show属性就行。不用来回查找,我感觉这样方便吧
因为最近也在写公司内部的组件,所以希望找一下好一点的实践
Beta Was this translation helpful? Give feedback.
All reactions