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)
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>
npm install --save react-native-hidden-action
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 | number | No | 8 | Number of taps required to trigger action |
clickTimeout | number | No | 3000 | Number of milliseconds after last tap to reset taps |
style | style | No | Styles for the container component |
Pull requests are welcome!
MIT.
Copyright © 2018 nkov.
Made with