react-native-hidden-action
v1.0.1
Published
Performs a "hidden" action when the user clicks several times quickly on this component (like the secret developer action in Android Settings)
Readme
react-native-hidden-action
Performs a "hidden" action when the user clicks several times quickly on this component (like the secret developer action in Android Settings)
Usage
By default, the action will be performed after the component is tapped 8 times in rapid succession (max 3 seconds between taps). To customize this behavior, see the props available below.
import HiddenAction from 'react-native-hidden-action'
<HiddenAction action={() => alert('Secret message!')}>
<Text>Click me!</Text>
</HiddenAction>Installation
npm install --save react-native-hidden-actionProps
Prop | Type | Required | Default | Description
--------------- | ------ | -------- | --------- | -----------
action | func | Yes | | The action to perform
feedback | bool | No | false | Whether to show feedback on press (ie. should use <TouchableOpacity>)
clickThreshold | num | No | 8 | Number of taps required to trigger action
clickTimeout | num | No | 3000 | Number of milliseconds after last tap to reset taps
style | style | No | | Styles for the container component
Contributing
Pull requests are welcome!
License
MIT.
Copyright © 2018 nkov.
Made with :hearts: in NYC.
