-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
state数据发生变化,视图没有同步改变 #3813
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
CC @yuche |
没看懂你的描述,是你这部分代码编译后直接就报图上的错,本来不报错,后来改了报错,「修改代码为先判断数组为空」的代码是怎么样的 |
|
「调整判断数组是否回空的先后顺序」是怎么样的代码 |
图二的右上角的代码 |
你先把 list 解构出来再用可以解决问题 1 |
刚测了一下问题一可以解决,表示感谢。 |
问题描述
state数据和视图没有同步改变
复现步骤
[复现问题的步骤]
期望行为
通过setState更新state后,视图同步发生变化
报错信息
系统信息
补充信息
修改代码为先判断数组为空返回空状态组件会产生图二的错误
The text was updated successfully, but these errors were encountered: