0.2.2 • Published 7 years ago

omit-props v0.2.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

omit-props

npm ci coverage deps

"Omit props" Higher-Order Component (HOC) for React, especially useful with Recompose to omit state setters, context or anything else you don't want to propagate to a component.

Install

yarn add recompose omit-props

Usage

import React from 'react';
import { compose, withProps } from 'recompose';
import omitProps from 'omit-props';

const Demo = (props) => (
  <h1>props: {JSON.stringify(props)}</h1>
  // props: {"c":3}
);

export default compose(
  withProps({ a: 1, b: 2, c: 3 }),
  omitProps('a', 'b')
)(Demo);

Development

yarn start
0.2.2

7 years ago

0.2.1

7 years ago

0.1.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago