我有這樣的代碼格式如下:createClass到組件類陣營轉換
const Test = React.createClass({
tabIcons: [],
propTypes: {
...
},
render() {
return
<View> ...</View>
}
})
我不知道如何將tabIcons轉換成新的格式
class Test extends Component {
static propTypes = {
...
}
render() {
return (
<View> ...</View>
)
}
}
你可以做'tabIcons = []'像你proptypes – Li357