2017-12-18 101 views
0

任何人都可以使用最新的React-Native init cmd指向組件語法的方向嗎?我不記得ES6類的語法非常喜歡它。RN組件語法

export default class App extends Component<{}> { 

} 

其中,我沒有看到括號以下內容。

export default class App extends Component { 

} 

由於

回答

0

參考:https://reactjs.org/docs/components-and-props.html

class Example extends Component { 
    render() { 
    return <h1>Hello</h1>; 
} 
} 

這是在反應定義組分的ES6方式。

+0

我的問題確實是組件<{}>部分,而不是。 <{}>語法的含義是什麼? – Fei