dvajs / dva

🌱 React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)
https://dvajs.com/
MIT License
16.24k stars 3.17k forks source link

state直接存贮dom节点,redux页面会很卡顿 #2483

Open fupeijie opened 2 years ago

fupeijie commented 2 years ago

What happens?

redux直接存贮e.target,页面会非常卡顿

How To Reproduce

Steps to reproduce the behavior: 1.截屏2022-02-06 10 50 33 2.截屏2022-02-06 10 51 57 3.截屏2022-02-06 10 52 46 4.截屏2022-02-06 10 53 23

Expected behavior 1.存储dom节点不卡顿或者其他替代方案获取dom节点信息

Context

geekact commented 2 years ago

redux存的都是plain object,dom节点不适合使用状态管理。我觉得你应该保存的是id或者其它唯一标识