reactjs

reactjs入门

日期:2016-08-31 阅读:729

官方文档:

https://facebook.github.io/react/docs/getting-started.html

 

其他文档:

http://www.ruanyifeng.com/blog/2015/03/react.html

http://www.ruanyifeng.com/blog/2016/05/react_router.html

http://www.css88.com/react/docs/getting-started.html

http://i5ting.github.io/reactjs-getting-start/

 

------------

 

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

 

createElement的理解: (和xml一样理解)

ReactElement createElement(
  string/ReactClass type,
  [object props],
  [children ...]  --子节点
)

-------

var Nav, Profile;
// Input (JSX):
var app = <Nav color="blue"><Profile>click</Profile></Nav>;


// Output (JS):
var app = React.createElement(
  Nav,
  {color:"blue"},

  React.createElement(Profile, null, "click")  --- 结果对应上面的绿色
);

--------

var Nav;
// Input (JSX):
var app = <Nav color="blue" />;
// Output (JS):


var app = React.createElement(Nav, {color:"blue"});

 

 

 

 

<<点击返回