Skip to content

ryanlntn/react-native-hoverable

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published