I've been looking at react recompose library and trying to grasp difference here, result is the same, tried to read docs, but got even more confused, why there is two ways to do same thing ?
const enhance = compose(
withState('counter', 'setCounter', 0),
withHandlers({
increment: props => () => props.setCounter(n => n + 1),
decrement: props => () => props.setCounter(n => n - 1)
})
)
const enhance = compose(
withState('counter', 'setCounter', 0),
withProps(({ setCounter }) => ({
increment: () => setCounter(n => n + 1),
decrement: () => setCounter(n => n - 1)
}))
)