npm.io
1.0.0 • Published 5 years ago

react-with-hocs

Licence
MIT
Version
1.0.0
Deps
0
Size
10 kB
Vulns
0
Weekly
0

react-with-hocs

npm version

A helper to compose React HOCs. Unlike the compose function, which is usually used in such cases, the withHocs receives the component first. This allows typescript to automatically infer types of HOCs, so you need not specify them manually.

import withHocs from "react-with-hocs";

...

export default withHocs(Component)(
  HOC1,
  HOC2,
  HOC3,
  ...
);

Keywords