1.0.4 • Published 3 years ago

native-x-tappable v1.0.4

Weekly downloads
13
License
MIT
Repository
github
Last release
3 years ago

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

PropertyDefault ValueUsage
disable?: booleanfalsePrevents all user interaction while this value is true
feedback?: booleanfalseShow a visible feedback
style: ViewStyleAdditional style
children: ReactNode/[]Content
onTap: (data: TData) => voidAction handler for user interaction
data: TDataundefinedOptional data

Automatic Release

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

Commit messageRelease type
fix: commentPatch Release
feat: commentMinor Feature Release
perf: commentMajor Feature Release
doc: commentNo Release
refactor: commentNo Release
chore: commentNo Release