Skip to main content

use_callback

Memoize a function identity between renders.

Parameters:

  • fn (Callable[P, R]) - A function to memoize.
  • dependencies (Sequence[Any] | None, default: None) - If present, fn is only re-memoized when one of the dependencies has changed. If absent, fn is only memoized on initial render.

Returns:

  • Callable[P, R] - A memoized version of the function whose identity is stable between renders.