react-native-hoverable
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

react-native-hoverable

Hover event support for React Native Catalyst

Installation

yarn add react-native-hoverable

Usage

import { Hoverable } from 'react-native-hoverable';

const HoverableView = () => (
  <Hoverable
    onMouseEnter={() => console.log('onMouseEnter')}
    onMouseLeave={() => console.log('onMouseLeave')}
    onMouseMove={() => console.log('onMouseMove')}
    style={({ hovered }) => [
      { padding: hovered ? 20 : 0 },
      { backgroundColor: 'purple' },
    ]}
  >
    {({ hovered }) => (
      <View
        style={{
          backgroundColor: hovered ? 'red' : 'green',
          height: 100,
          width: 100,
        }}
      />
    )}
  </Hoverable>
);

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Package Sidebar

Install

npm i react-native-hoverable

Weekly Downloads

131

Version

0.2.0

License

MIT

Unpacked Size

176 kB

Total Files

53

Last publish

Collaborators

  • ryanlntn