We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我按照思路写了一个类似的,放到安卓虚拟机上跑。在计次的时候,就算是4G的内存还是会显得很卡,但是在没有写记录之前,之前的操作都是很流畅的,想知道是什么原因导致的,state的结构与您的基本一致。 计次的时候更新state操作为 let newRecord = Object.assign(this.state); newRecord.recordTime = (new Date()).getTime(); newRecord.count++; if (newRecord.count > 8) { newRecord.record.pop(); } newRecord.record.unshift({ title: "计次" + newRecord.count, time: this.state.currentTime }); this.setState(newRecord);
The text was updated successfully, but these errors were encountered:
把计时器的Interval时间改长。 从setState更新数据到界面反馈,需要完成一次DOM更新,速度可想而知。
Sorry, something went wrong.
No branches or pull requests
我按照思路写了一个类似的,放到安卓虚拟机上跑。在计次的时候,就算是4G的内存还是会显得很卡,但是在没有写记录之前,之前的操作都是很流畅的,想知道是什么原因导致的,state的结构与您的基本一致。
计次的时候更新state操作为
let newRecord = Object.assign(this.state);
newRecord.recordTime = (new Date()).getTime();
newRecord.count++;
if (newRecord.count > 8) {
newRecord.record.pop();
}
newRecord.record.unshift({
title: "计次" + newRecord.count,
time: this.state.currentTime
});
this.setState(newRecord);
The text was updated successfully, but these errors were encountered: