码迷,mamicode.com
首页 > 其他好文 > 详细

React

时间:2017-02-12 21:15:06      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:github   art   read   amp   wrap   for   always   gui   指定   

React

1、The smallest React example looks like this:

  技术分享

2、You can embed any JavaScript expression in JSX by wrapping it in curly braces.

  技术分享

3、After compilation, JSX expressions become regular JavaScript objects.

  This means that you can use JSX inside of if statements and for loops.

  技术分享

4、通过“”或{}指定属性

  技术分享

  技术分享

  Don‘t put quotes around curly braces when embedding a JavaScript expression in an attribute. Otherwise JSX will treat the attribute as a string literal rather than an expression. 

5、React Only Updates What‘s Necessary

6、The simplest way to define a component is to write a JavaScript function:

  技术分享

  You can also use an ES6 class to define a component:

  技术分享

7、Rendering a Component,Always start component names with a capital letter.

  技术分享

8、Typically, new React apps have a single App component at the very top.

  技术分享

9、Props are Read-Only

  

参考:

https://facebook.github.io/react/docs/introducing-jsx.html

React

标签:github   art   read   amp   wrap   for   always   gui   指定   

原文地址:http://www.cnblogs.com/tekkaman/p/6391767.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!