Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use-reducer hook supplies arguments to the reducing function in the "wrong" order #213

Closed
cjsauer opened this issue Jun 27, 2020 · 0 comments

Comments

@cjsauer
Copy link
Contributor

cjsauer commented Jun 27, 2020

Was just bitten by this and it took a bit of debugging. React's own signature for the reducing function passed to useReducer is reducer(state, event), however Rum's wrapper for the hook is reversing the order of these parameters:

(.useReducer js/React #(reducer-fn %2 %1) initial-value identity)))

Was this accidental? It's unfortunate that it doesn't match the signature of the underlying React hook, but also that it doesn't match the signature of Clojure core's own reduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant