# react-redux-connect-lifecycle

> A higher-order component to connect a React component to a redux store with component 'mount' lifecycle events

Latest version **1.0.2** (published 2019-05-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-redux-connect-lifecycle
pnpm add react-redux-connect-lifecycle
yarn add react-redux-connect-lifecycle
bun add react-redux-connect-lifecycle
```

## 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.0.2 |
| Published | 2019-05-02 |
| First published | 2017-10-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Gency |
| Maintainers | ttoohey |
| Keywords | react, redux, lifecycle |

## Links

- npm: https://www.npmjs.com/package/react-redux-connect-lifecycle
- Repository: https://github.com/ttoohey/react-redux-connect-lifecycle
- Homepage: https://github.com/ttoohey/react-redux-connect-lifecycle#readme
- Issues: https://github.com/ttoohey/react-redux-connect-lifecycle/issues
- npm.io page: https://npm.io/package/react-redux-connect-lifecycle

## 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.0.2 (latest) — 2019-05-02
- 1.0.1 — 2018-12-18
- 1.0.0 — 2017-10-10

## README

# react-redux-connect-lifecycle

A higher-order component to connect a React component to a redux store with component 'mount' lifecycle events.

## Usage

In a container, connect() is used just like connect() from 'react-redux'. The difference is lifecycle events will be added to the component and can be dispatched as actions.

Each lifecycle event has the component's 'props' passed as the only argument.

```js
// MyComponentContainer.js
import connect from 'react-redux-connect-lifecycle'
import MyComponent from './MyComponent'

const mapStateToProps = state => ({
  /* ... */
})

const mapDispatchToProps = ({
  /* ... */
  onComponentWillMount  : (props) => ({ type: 'WILL_MOUNT'  , props }),
  onComponentDidMount   : (props) => ({ type: 'DID_MOUNT'   , props }),
  onComponentDidUpdate  : (props) => ({ type: 'DID_UPDATE'  , props }),
  onComponentWillUnmount: (props) => ({ type: 'WILL_UNMOUNT', props })
})

export default connect(mapStateToProps,mapDispatchToProps)(MyComponent)
```

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