1.0.3 • Published 6 years ago

react-exclude-props v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

react-exclude-props

Extend a component with extra properties in a way that typescript can understand. These extra properties are not actually passed down, so don't trigger warnings, but can be used in styled-components to modify the element's style.

Usage

import excludeProps from 'react-exclude-props';

const Button = excludeProps('button', p => ({active: p<boolean>()}));
const StyledButton = styled(Button)`
  color: ${props => props.active ? 'green' : 'black'};
`;

export default StyledButton;
1.0.3

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago