高阶组件实际上是个函数react
使用组件做为参数或者函数返回值是一个组件npm
高阶组件的使用:react-native
1.定义一个函数,参数是一个组件,函数返回值是一个组件babel
2.@高阶组件名函数
1.npm run ejectco
2.npm install babel-preset-stage-2 --save-dev参数
3.npm install babel-preset-react-native-stage-0 --save-devdecorator
4.根目录下建立.babelrc ab
{tag
presets: [react-native-stage-0/decorator-support]
}