QAP的组件都是在是RAX的基础上构建的,所以在写qap组件的时候,都需要先引入rax,并在Component上扩展自己的方法。rax就是组件和QAP容器通信的桥梁。用户写的组件都可以称为rax组件,rax组件采用的语法和生命周期都等同于React,可以认为rax是类React的框架。要了解rax,可以先了解React语法。
如果你还不了解React,建议先学习React。关于react 与 jsx https://facebook.github.io/react/,或者参考 http://reactjs.cn/react/docs/getting-started-zh-CN.html。
与React 不同,Rax 没有全局的Rax
变量。但与React 类似的是,具有以下 Top level api
- createElement
- cloneElement
- createFactory
- render
- Component
- PureComponent
- PropTypes
- findDOMNode
- unmountComponentAtNode
- findComponentInstance
- setNativeProps(Rx 独有)
import {createElement, Component, render} from 'rax';