React Component(dva)

Stateless Functional Components(3种方式)

class App extends React.Component
function App()
const App= React.createClass

JSX

 Component 嵌套

  <App>
    <MainContent />
  </App>

 className

  class是保留词,需用 className 代替 class 

 JavaScript 表达式

  <h1>{ this.props.children }</h1>

 Mapping Arrays to JSX

  { array.map((item, i) => <li key={i}>{item}</li>) }

 Spread Attributes

  const attrs = {
    href: 'http://example.org',
    target: '_blank',
  };
  <a {...attrs}>Hello</a>
posted @ 2017-09-19 17:36  新逸辰枫  阅读(331)  评论(0编辑  收藏  举报