zoukankan      html  css  js  c++  java
  • react-native decorator

    使用Decorator 首先要安装相应的Babel插件

    npm install babel-plugin-transform-decorators-legacy --save,同时,需要在.babelrc中的plugins里做相应配置:

    "plugins": [
      "transform-class-properties",
      "babel-plugin-transform-decorators-legacy"
    ]

    在react-native中移除Decorator警告 jsconfig.json

    {
        "compilerOptions": {
            "experimentalDecorators"true,
            "allowJs"true
        }
    }
    点击空白处键盘隐藏(react-native)
    const dismissKeyboard = require('dismissKeyboard')
    export default (WrappedComponent) => class AutoHideKeyboard extends Component {
        render() {
            return (
                <TouchableWithoutFeedback style={{flex:1}} onPress={dismissKeyboard}>
                    <View style={{flex:1}}>
                        <WrappedComponent {...this.props}/>
                    </View>
                </TouchableWithoutFeedback>
            )
        }
    }
  • 相关阅读:
    关于网页编码转换的几种方法
    java加载静态properties的方法
    js 点击 li 获取 设定的参数信息
    添加网关信息
    SQL 函数
    SQL Date函数
    SQL 视图(VIEW)
    SQL高级语法3
    SQL 约束
    SQL 创建表
  • 原文地址:https://www.cnblogs.com/oldcownotGiveup/p/7085541.html
Copyright © 2011-2022 走看看