[React] React Fundamentals: JSX Deep Dive
2015-08-26 19:25
597 查看
"JSX transforms from an XML-like syntax into native JavaScript. XML elements and attributes are transformed into function calls and objects, respectively."
Input:
output:
Input:
React.createClass({ render: function(){ var style = { backgroundColor: '#ccc', color: blue }; return ( <div > <a href="#" style={style}/> {/*This is comment*/} Thisis message {/*JSX don't have if else*/} {i > 1 ? 'More than one' : 'one'} {i>1&& 'More than one' } </div> ) } })
output:
React.createClass({ render: function(){ var style = { backgroundColor: '#ccc', color: blue }; return ( React.createElement("div", null, React.createElement("a", {href: "#", style: style}), " ", /*This is comment*/" Thisis message", /*JSX don't have if else*/ i > 1 ? 'More than one' : 'one', i>1&& 'More than one' ) ) } })
相关文章推荐
- [React] React Fundamentals: Build a JSX Live Compiler
- 说说ReactiveCocoa 2
- [ACdream 1211 Reactor Cooling]无源无汇有上下界的可行流
- ReactiveCocoa - iOS开发的新框架
- ReactJS入门二
- ReactiveCocoa基本组件:理解和使用RACCommand
- ReactJS入门学习二
- ReactiveCocoa 学习资料
- iOS.ReactNative-4-react-native
- ReactiveCocoa与Functional Reactive Programming
- ReactiveCocoa - iOS开发的新框架
- 前端框架react研究
- PNP管理器简析--基于ReactOS0.33
- 前端框架react研究
- Netty与Reactor模式
- react事件获取元素
- 高性能IO模型浅析-Reactor与Proactor
- Reactor模式-反应器模式
- ReactiveCocoa与Functional Reactive Programming
- ReactiveCocoa学习笔记