# hoist-react-statics

> Dont forget to hoist all props from a base component

Latest version **1.0.2** (published 2018-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install hoist-react-statics
pnpm add hoist-react-statics
yarn add hoist-react-statics
bun add hoist-react-statics
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-12-06 |
| First published | 2017-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 76.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Anton Korzunov |
| Maintainers | kashey |
| Keywords | hoc, react, hoist, propTypes, flow, ts |

## Links

- npm: https://www.npmjs.com/package/hoist-react-statics
- Repository: https://github.com/thekashey/hoist-react-statics
- Issues: https://github.com/thekashey/hoist-react-statics/issues
- npm.io page: https://npm.io/package/hoist-react-statics

## Dependencies (2)

- [react-display-name](https://npm.io/package/react-display-name.md) ^0.2.3
- [hoist-non-react-statics](https://npm.io/package/hoist-non-react-statics.md) ^2.3.1

## 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) — 2018-12-06
- 1.0.1 — 2018-01-03
- 1.0.0 — 2017-12-21

## README

[![NPM](https://nodei.co/npm/hoist-react-statics.png?downloads=true&stars=true)](https://nodei.co/npm/hoist-react-statics/)

## The problem

How many times you wrap one component by another? Use the React's HOC paradigm?
```js
const MySuperComponentWrapper = props => (
   <AmazingStuff><WrappedComponent {...props} /></AmazingStuff>
)
```
That about propTypes? types?

## The Solution 
```js
import hoistReactStatics from 'hoist-react-staticsr';

const MySuperComponentWrapper = hoistReactStatics(props => (
  <AmazingStuff><WrappedComponent {...props} /></AmazingStuff>
), WrappedComponent);
```

## But why?
Are you mad mate? I need only one line to solve this problem! I have written 
```js
const MySuperComponentWrapper = props => (
   <AmazingStuff><WrappedComponent {...props} /></AmazingStuff>
)
MySuperComponentWrapper.propTypes = WrappedComponent.propTypes;
```

But 
- what about Flow/TS types?   
Huh?

# Licence
 MIT

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