0.2.0 • Published 1 year ago

react-native-hoverable v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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