state={ newAddress: this.props.address, }
-------------------------------------------------------------------------------------------------
constructor(props){ super(props); this.state={ newAddress: this.props.address, } }
关于上面两种写法,是否结果是第一种newAddress能取到值,而第二种值会是undefined。
相关分类