unihooks icon indicating copy to clipboard operation
unihooks copied to clipboard

Conceptual discrepancy with react hooks / useArguments === props

Open dy opened this issue 5 years ago • 0 comments

React hooks are enclosed - only component itself can trigger own update. Hooks don't subscribe component to external events. The only subscription, triggering component rerendering is props.

unihooks (as well as many other hooks libs) break that convention and subscribe to external data sources. First of all breaking that redux - useSelector literally makes component react on store changes, circumventing props, drawing props in general case a rudiment, not required by reactive function. Literally props mean useArguments, with subscription to function call with new args.

dy avatar Dec 17 '19 20:12 dy