First of all — thanks for the clever idea @mweststrate!
Patch implements memoization for the returned function: creation of new function (and, accordingly, a new memory reference) only depends on internal state change and not from props outside of hook. This allows to avoid unnecessary rerenders of dependant react components.
First of all — thanks for the clever idea @mweststrate!
Patch implements memoization for the returned function: creation of new function (and, accordingly, a new memory reference) only depends on internal state change and not from props outside of hook. This allows to avoid unnecessary rerenders of dependant react components.