Closed harrysolovay closed 5 years ago
@harrysolovay It's because of reset
function. It's not possible to implement reset for "native" setState
because it's always extended, not overridden.
Ahhh, I see. That makes a lot of sense. Thank you 👍
It may not seem like it, but it simplifies a lot as well! Look https://github.com/renatorib/react-powerplug/pull/149
Hi,
I have a question about the component hierarchy: Why is it that the
State
component is using theValue
component? It appearsValue
implements setState within its_set
method, which scopes it to the state'svalue
member. Then, theState
component is wrapped withValue
, which implements a new setState that calls the _set passed fromValue
... this means that setState/_set is unnecessarily implemented twice... also, theState
component scopes setState tovalue
(internally), which isn't necessary (might as well use the built-in setState). Also, there's an extra container in the mix. Please let me know if there was some other thinking behind this... I don't mean to sound critical... I'm just looking for opportunities to contribute to this library. I really dig the render-props pattern & wanna improve/add to this lib with features more geared toward global state management.Please let me know your thoughts & thanks for looking this over.
Kind regards,
Harry