Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 867 Bytes

README.md

File metadata and controls

42 lines (30 loc) · 867 Bytes

react-native-new-action-sheet

React Native Action Sheet module for android and ios

Instalation

yarn add react-native-new-action-sheet

You need to link it manually on android if you are using react-native < 60.

How to use ?

import ActionSheet from 'react-native-new-action-sheet';

ActionSheet.showActionSheet(['Banana', 'Apple', 'Cancel'], (index) => {
    // check that not cancel button was pressed in the action-sheet
    if (index !== 2) {
        console.log(`index:${index} was pressed`);
    }
});

const params = Platform.OS === 'ios' ? {
    subject: '',
    message: 'Message to share',
} : {
    url: '',
    subject: '',
    message: 'Message to share',
    title: 'Share',
};

ActionSheet.showShareSheet(params);

Description

On IOS it's a wrapper on ActionSheetIOS. On Android it's a custom solution.