Closed CaptainN closed 4 years ago
I'd actually like to make this an optional 2nd OR 3rd argument. The second argument is a deps array, but I'd like to be able to accept a config object instead (overload style). This might make sense to do after the Typescript conversion lands, since there's now a split in the two versions of the hook - with/without deps, and the overload decision can be cleaning implemented there.
Change the third parameter (currently undocumented) to accept an option object with two optional nodes -
shouldUpdate
and the already presentcomputationHandler
. This proposed change would make it possible to reduce rerenders by providing a comparison function, to check old values, with new values.shouldUpdate
option@menelike