UNPKG

@activatortube/react-native-form

Version:
39 lines (38 loc) 1.35 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); /** * 开关组件 * 2019-09-07 16:25. * * @author WheelerLee https://github.com/WheelerLee * @copyright 2019 */ import React from 'react'; import { Switch as NativeSwitch } from 'react-native'; import BaseFormItem from './BaseFormItem'; var Switch = /** @class */ (function (_super) { __extends(Switch, _super); function Switch() { return _super !== null && _super.apply(this, arguments) || this; } Switch.prototype.render = function () { var _this = this; return (<NativeSwitch {...this.props} onValueChange={function (value) { _this.value = value; _this.props.onValueChange && _this.props.onValueChange(value); }}/>); }; return Switch; }(BaseFormItem)); export default Switch;