Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bluewings/with-hocs


https://github.com/bluewings/with-hocs

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# with-hocs

```jsx
import withHOCs from 'with-hocs';
import { defaultProps, withPropsOnChange } from 'recompose';

function Sample(props) {
return

HELLO {props.capitalized}!

;
}

// pass high-order components via hocs props
const Enhance = withHOCs({ importAs: 'hocs' })(Sample);

const hocs = [
defaultProps({
name: 'World',
}),

withPropsOnChange(['name'], ({ name }) => ({
capitalized: name.toUpperCase(),
})),
];

// HELLO SYDNEY!

```