davidkomer
davidkomer

Reputation: 3078

withState vs. withStateHandlers

The docs @ https://github.com/acdlite/recompose/blob/master/docs/API.md#withstate says this regarding withState

You'll likely want to use this state updater along with withHandlers() to create specific updater functions.

Then it has a separate function withStateHandlers() which seems similar though in a slightly different form.

In terms of practical use and why one would be used instead of the other, how do they differ?

Upvotes: 1

Views: 2052

Answers (1)

wuct
wuct

Reputation: 10477

Actually withStateHandlers() hasn't appeared until recently version of recompose. I'd recommend that use withStateHandlers() instead of combining withState() and withHandlers() if you can.

The doc under withState() probably need update.

Upvotes: 4

Related Questions