F

useShallow

Wraps a selector so a result shallow-equal to its last one returns the last one, which skips the re-render.

function useShallow<S, U>(selector: (state: S) => U): (state: S) => U

Parameters

NameTypeDescription
selector(state: S) => U

Returns

(state: S) => U