課程
/前端開發(fā)
/React.JS
/React組件
報錯了什么情況
2018-06-07
源自:React組件 2-12
正在回答
需要在LightningCounter的開始就初始化state.strikes LightningCounter?{ ????getInitialState:function(){ ????????return?{strikes:value}; ????} ???? ?}
zflhcc 提問者
親你怎么改好的? ?
constructor(props){
super(props);
this.state={
strikes:0
}
getInitialState(){
return {
我這樣寫了 還是找不到呢
舉報
帶你了解如何創(chuàng)建好擁有各自狀態(tài)的組件,再由組件構成更加復雜的界面
1 回答Uncaught TypeError: Cannot read property 'strikes' of undefined at timerTriker (APP3.js:19)
1 回答css不帶單位問題
3 回答componentDidMount視頻中是不是說錯了
1 回答getDefaultProps ,getInitialState這兩個方法不能用呀
1 回答老師,樣式寬高的數(shù)值不用添加 單位嗎?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關注慕課網(wǎng)微信公眾號
2018-06-11
2019-05-22
親你怎么改好的? ?
constructor(props){
super(props);
this.state={
strikes:0
}
}
getInitialState(){
return {
strikes:0
}
}
我這樣寫了 還是找不到呢