箭頭函數(shù)
react 在使用箭頭函數(shù)時(shí) this的指向是定義時(shí)所在的對(duì)象 而不是使用時(shí)所在的對(duì)象椒丧。
所以不需要this.getdata = this.getdata.bind()
props
props的值是所有組件'父,子'都可以用到的值 可用在傳值的時(shí)候
ref
自我理解為 用于獲取當(dāng)前dom元素?<input ref="conten" type="text"/>
但官方不推薦這樣寫(xiě) 所以
<input ref={input =>this.conten = input} type="text"/>?
獲取這個(gè)dom 用?this.conten 獲取?conten為自定義