
Security News
Oxlint Introduces Type-Aware Linting Preview
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
@luu-truong/react-native-reaction-button
Advanced tools
Reactions button like Facebook does.
Yarn:
yarn add @luu-truong/react-native-reaction-button
NPM:
npm install @luu-truong/react-native-reaction-button
import ReactionButton from '@luu-truong/react-native-reaction-button'
function Demo() {
const [value, setValue] = React.useState(-1);
function onChange(index: number) {
setValue(value === index ? -1 : index);
}
const reactions = [
{
source: {
url: '...'
},
title: 'Like'
},
{
source: require('....'),
title: 'Haha'
}
];
return <ReactionButton reactions={reactions} defaultIndex={0} value={value} onChange={onChange} />
}
Name | Type | Required | Description |
---|---|---|---|
debug | boolean | no | Debug message. Default: false |
reactionSize | number | no | Render reaction image at size. Default: 40px |
reactions | ReactionItem[] | yes | List reactions |
value | number | yes | Selected reaction index. |
defaultIndex | number | no | Default reaction |
onChange | (index: number) => void | yes | Callback when a reaction pressed |
textProps | object | no | Props passed to button reaction text |
reactionSmallSize | number | no | Size to render reaction in button |
DefaultImage | (passedProps: any) => JSX.Element | no | Default image component to render reaction when value is unspecified |
reactionContainerStyle | object | no | Style apply to reactions popover container |
imageProps | {renderImage: (props) => JSX.Element} | no | |
style | ViewStyle | no | |
hitSlop | {top: number; left: number; right: number; bottom: number} | no |
ReactionItem properties:
Name | Type | Required | Description |
---|---|---|---|
source | object | yes | Image object source |
title | string | yes | Reaction title |
Version | react-native version |
---|---|
1.x.x | 0.64.0+ |
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.