React 应对setState后值不能立即更新

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

setPasswordFirst: function (password)
{

this.setState({
passwordFirst: password
}, function(){this.check()});

},
check: function (){
this.refs.passwordAgainCheck.sameCheckAgain(this.state.passwordFirst, this.state.passwordSecond);
},
setPasswordSecond: function (password)
{
this.setState({
passwordSecond: password
}, function(){this.check()});
},
this.setState的值是不会立即更新的,如果在this.setState()后面再输出this.state.passwordFirst,值还是原来的。这时候利用setState的回调函数即可。
Newer Post

i春秋30强CTF

web狗的writeup id:l4t0_0能看到吗?查看源代码得到flag{a2714506-b3e2-417d-bac9-e8d078ed4d96} 加密的地址注释里面 flag{455ec542-5f3e-4cd6-beb0-26a5e67338fe} …

,
Older Post

CentOS7/Firewall配置shadowsocks[Conoha]

shadowsocks1234yum install -y python-setuptoolseasy_install pippip install shadowsocksvim /etc/shadowsocks/config.json 123456789{ "serv …

, , ,