1.什麼是const {xxx}= this?
答上面的寫法是es6的寫法,其實就相當於:
const xxx = this.state.xxx
擴充
const {a,b,c} = this
上面的這句話是一個簡寫,最終的含義相當於
const a = this.a
const b = this.b
const c = this.c
const xxx = this.state.xxx
const {a,b,c} = this
上面的這句話是一個簡寫,最終的含義相當於
const a = this.a
const b = this.b
const c = this.c