第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

為啥我上來就報React.createClass is not a function啊

Uncaught TypeError: React.creatClass is not a function

源碼如下:

<!DOCTYPE html> ? ?

<html lang="en"> ? ?

<head> ? ?

<meta charset="UTF-8"> ? ?

<script src="http://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react.js"></script> ? ?

<script src="http://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/JSXTransformer.js"></script> ? ?

<title>Document</title> ? ?

</head> ? ?

<body> ? ?

? ?

<div id="container"></div> ? ?

<script type="text/jsx"> ? ?

console.log(React) ? ?

var TestClickComponent = React.creatClass({ ? ?

render:function(){ ? ?

? return ( ? ?

? ? <div> ? ?

? ? ? <button>顯示|隱藏</button><span>點擊測試</span> ? ?

</div> ? ?

); ? ?

? } ? ?

}); ? ?

var TestInputComponent = React.creatClass({ ? ?

getInitialState:function(){ ? ?

? return{ ? ?

? ? inputContent:"" ? ?

} ? ?

}, ? ?

render:function(){ ? ?

? return ( ? ?

? ? <div> ? ?

? ? ? <input type="text"/><span>{this.state.inputContent}</span> ? ?

? ? ? </div> ? ?

); ? ?

} ? ?

}); ? ?

React.render( ? ?

<div> ? ?

<TestClickComponent/> ? ?

<TestInputComponent/> ? ?

</div>, ? ?

document.getElementById('container')); ? ?

</script> ? ?

</body> ? ?

</html> ? ?


正在回答

3 回答

我也遇到相同的問題,應(yīng)該是版本不對吧。

0 回復(fù) 有任何疑惑可以回復(fù)我~

使用es6語法

0 回復(fù) 有任何疑惑可以回復(fù)我~

應(yīng)該是 React.createClass,你少些了一個creat(e)

1 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消
React入門
  • 參與學(xué)習(xí)       122096    人
  • 解答問題       126    個

顛覆式前端UI開發(fā)框架React入門視頻教程,趕緊學(xué)起來

進(jìn)入課程

為啥我上來就報React.createClass is not a function啊

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號