Skip to content

rintoj/native-x-image

Repository files navigation

native-x-image

semantic-release

Wrap this component around another component to enable user interaction

Install

Yarn

yarn add native-x-image

NPM

npm install native-x-image

Note: This module uses react-native-fast-image internally. Make sure you have it configured.

See: react-native-fast-image

Usage

import { Image } from 'native-x-image'

function MyComponent() {
  const onTap = () => {
    // handle action
  }
  return <Image source={{ uri: 'https://' }} />
}

// or with local

function MyComponent({ user }: { user: User }) {
  const onTapUser = (user: User) => {
    // handle action
  }
  return <Image source={require('./local-image.png')} />
}

API

Property Default Value Usage
source: Source Image to show
fill?: boolean false Fill width of the container
width?: number Width of the image
height?: number Height of the image
resizeMode: ResizeMode 'fill' Valid values: contain, cover, stretch, center
fallbackSource: Source Image to show when the image is not available

And all properties from:

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published