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

react-native-choose-image-button

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-choose-image-button

Wrappable conponent that allows for native bindings of choosing images from library or camera

latest
npmnpm
Version
1.0.5
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

React Native Choose Image Button

  • React Native wrappable component
  • Choose image or take photo, the resultant image is then passed to a callback you provide
  • Optional styles can be passed via props

Getting Started

Installation

npm install react-native-choose-image-button --save

Example

This library uses the @expo/react-native-action-sheet dependency so first wrap your app with the ActionSheetProvider class which serves as a container for calling the native action popup that shows the options 'Take photo', 'Choose Image' etc...

import { ActionSheetProvider, connectActionSheet } from '@expo/react-native-action-sheet';

export default class App extends React.Component {
  render() {
    return (
      <ActionSheetProvider>
        <RootApp />
      </ActionSheetProvider>
    );
  }
}

Then wrap your target button with the choose image button:

import Icon from 'react-native-vector-icons/Ionicons';
import ChooseImageButton from 'react-native-choose-image-button';

const UploadButton = () => {

    return(
        <ChooseImageButton
        onLoading={someFunction}
        onComplete={someFunction}
        style={someStyle}>
            <Icon name="ios-add"/>
        </ChooseImageButton>
    );

}

Props

PropDescription
styleAn style object to apply styles to the component
onLoadingThe function that is called when the image is buffering and loading
onCompleteThe function that receives the resultant base64 image

FAQs

Package last updated on 15 Apr 2018

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