# react-with-hover

> Simple hover high order function.

Latest version **1.2.0** (published 2018-01-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-with-hover
pnpm add react-with-hover
yarn add react-with-hover
bun add react-with-hover
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2018-01-29 |
| First published | 2016-05-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Team Magneto |
| Maintainers | ggarnier, sergioazevedo, daniel.acfilho, aitherios |
| Keywords | react, with-hover, isomorphic, inline-style, high-order-component |

## Links

- npm: https://www.npmjs.com/package/react-with-hover
- Repository: https://github.com/aitherios/react-with-hover
- Homepage: https://github.com/aitherios/react-with-hover#readme
- Issues: https://github.com/aitherios/react-with-hover/issues
- npm.io page: https://npm.io/package/react-with-hover

## Dependencies (2)

- [recompose](https://npm.io/package/recompose.md) >= 0.26.0
- [prop-types](https://npm.io/package/prop-types.md) >= 15.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2018-01-29
- 1.1.1 (alpha) — 2016-06-14
- 1.1.2 — 2016-06-14
- 1.1.0 — 2016-05-09
- 1.0.0 — 2016-05-09

## README

# react-with-hover
[![npm version](https://img.shields.io/npm/v/react-with-hover.svg?style=flat-square)](https://www.npmjs.com/package/react-with-hover)
[![dependency status](https://img.shields.io/david/aitherios/react-with-hover.svg?style=flat-square)](https://david-dm.org/aitherios/react-with-hover)
[![build status](https://img.shields.io/travis/aitherios/react-with-hover.svg?style=flat-square)](https://travis-ci.org/aitherios/react-with-hover)


Simple React high order function to expose when the component is being hovered.

## Usage

Let's build an example react component:

```js
const Header = ({ style }) => (<h1 style={style}>Header</h1>)
```

And decorate:

```js
import WithHover from 'react-with-hover'

const Decorated = WithHover()(Header)
```

Now when you use `<Decorated />` it will pass a boolean property `hover`.

You can change the property name by passing a function, example:

```js
const Decorated = WithHover(
  { transform: (flag) => ({ mouseOver: flag }) }
)(Header)
```

The property passed to the `Header` would change to `mouseOver`

You can also change the wrapper div style to meet your needs like:

```js
const Decorated = WithHover(
  { containerStyle: { display: 'inline-block' } }
)(Header)
```

## Contributing

First of all, **thank you** for wanting to help!

1. [Fork it](https://help.github.com/articles/fork-a-repo).
2. Create a feature branch - `git checkout -b more_magic`
3. Add tests and make your changes
4. Check if tests are ok - `npm test`
5. Commit changes - `git commit -am "Added more magic"`
6. Push to Github - `git push origin more_magic`
7. Send a [pull request](https://help.github.com/articles/using-pull-requests)! :heart: :sparkling_heart: :heart:

---
_Source: https://npm.io/package/react-with-hover · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
