0
我想知道爲什麼我無法在反應功能中使用渲染器。下面的代碼有錯誤。任何線索?渲染器無法在反應功能中使用
renderNewApplicants = (items) => {
let new_applicants = items.filter(obj =>
obj.applicants.result.is_new === true
)
render(){
return(//map new_applicants here)
}
}
然後在JSX別的地方我做{this.renderNewApplicants}
你不能叫'render'在此way.Use'setState'更新將CLL渲染你的狀態。 https://facebook.github.io/react/docs/state-and-lifecycle.html –