New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mkp-react-native-button

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkp-react-native-button

react-native-button

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
2
Created
Source

react-native-button

npm version npm license npm download npm download

React Native Button

Install

$ npm install mkp-react-native-button --save

Support

ios/android

Quick Start

import Button from "mkp-react-native-button";

<Button
    styles={buttonStyles}
    disabled={true}>disabled</Button>
    
<Button 
    styles={buttonStyles} 
    onPress={event=>{
        this.message("i am pressed");
    }}>button</Button>
    
<Button 
    styles={buttonStyles} 
    onPress={(event,callback)=>{
        this.message("begin fetch ...");
        setTimeout(()=>{
            this.message("end fetch")
            callback();
        },2000);
    }}>async button</Button>
    
<Button 
    styles={{view:{
        marginTop:5,
        borderRadius:10
    }}}>border readius button</Button>
    
<Button 
    styles={buttonStyles}
    onPress={event=>{
        this.message("image button is pressed")
    }}>
    <Image source={require("./assets/button.png")}/>
</Button>

Props

children:any

You can specify a string or component for children.if that is string will render a .

disabled:Boolean

styles:Object

styles is a object consist of view,text,disabledView,disabledText.following simple code:

styles={
    view: {},
    text: {},
    disabledView: {},
    disabledText: {}
}

onPress:Function

invoke when button is pressed.following simple code:

<Button
    onPress={event=>{
    	//do something
    }}>button</Button>

when fetch data from remote , button can be disable before response come back later restore . if you want to get the effect you must provide the second parameter in onPress , and all of request is done you need to invoke callback. following code:

<Button
    onPress={(event,callback)=>{
    	//begin request
    	fetch("").then(res=>{
    		callback();
    	});
    }}>button</Button>

activeOpacity:Number

Marking the button's opacity when pressIn.

Keywords

react-native

FAQs

Package last updated on 11 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts