1.0.1 • Published 7 years ago

react-native-dj-switch v1.0.1

Weekly downloads
2
License
ISC
Repository
-
Last release
7 years ago

Toast

accordion

Install

npm i --save react-native-dj-switch

Usage

Using in your app will usually look like this:

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  TouchableHighlight,
} from 'react-native';

import Switch from 'react-native-dj-switch';


export default class NPMTest extends Component {

    render() {
      return (
        <View style={{marginTop:20}}>
          <Switch open={true} onChange={this.onChange.bind(this)} />
        </View>
      );
    }
}

AppRegistry.registerComponent('xxx', () => NPMTest);

Props

The following props can be used to modify the style and/or behaviour:

PropTypeOpt/RequiredDefaultNote
openbooleanOptionfalse控制UI是否处于打开状态,不控制数据状态,数据状态请自行控制
onChangefunctionOption| 状态改变触发的动作

Methods

The following methods can be used to open and close the Dialog:

MethodParametersNote