1.0.1 • Published 6 years ago

react-native-hidden-action v1.0.1

Weekly downloads
42
License
MIT
Repository
github
Last release
6 years ago

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-action

Props

PropTypeRequiredDefaultDescription
actionfuncYesThe action to perform
feedbackboolNofalseWhether to show feedback on press (ie. should use <TouchableOpacity>)
clickThresholdnumNo8Number of taps required to trigger action
clickTimeoutnumNo3000Number of milliseconds after last tap to reset taps
stylestyleNoStyles for the container component

Contributing

Pull requests are welcome!

License

MIT.

Copyright © 2018 nkov.

Made with :hearts: in NYC.