npm.io
1.0.4 • Published 5 years ago

native-x-tappable

Licence
MIT
Version
1.0.4
Deps
0
Size
5 kB
Vulns
0
Weekly
0

native-x-tappable

semantic-release

Wrap this component around another component to enable user interaction

Install

Yarn

yarn add native-x-tappable
NPM
npm install native-x-tappable

Usage

import { Tappable } from 'native-x-tappable'

function MyComponent() {
  const onTap = () => {
    // handle action
  }
  return <Tappable onTap={onTap}>
    {...}
  </Tappable>
}

// or with data

function MyComponent({ user }: { user: User}) {
  const onTapUser = (user: User) => {
    // handle action
  }
  return <Tappable data={user} onTap={onTapUser}>
    {...}
  </Tappable>
}

API

Property Default Value Usage
disable?: boolean false Prevents all user interaction while this value is true
feedback?: boolean false Show a visible feedback
style: ViewStyle Additional style
children: ReactNode/[] Content
onTap: (data: TData) => void Action handler for user interaction
data: TData undefined Optional data

Automatic Release

Here is an example of the release type that will be done based on a commit messages:

Commit message Release type
fix: [comment] Patch Release
feat: [comment] Minor Feature Release
perf: [comment] Major Feature Release
doc: [comment] No Release
refactor: [comment] No Release
chore: [comment] No Release