def METHOD_NAME(self, render_function: Callable[..., Any]) -> Callable[..., Any]:
    """Decorator for capturing a ``LifeCycleHook`` on each render of a component"""
    # The render function holds a reference to `self` and, via the `LifeCycleHook`,
    # the component. Some tests check whether components are garbage collected, thus
    # we must use a `ref` here to ensure these checks pass once the catcher itself
    # has been collected.
    self_ref = ref(self)
    @wraps(render_function)
    def wrapper(*args: Any, **kwargs: Any) -> Any:
        self = self_ref()
        if self is None:
            raise RuntimeError("Hook catcher has been garbage collected")
        hook = current_hook()
        if self.index_by_kwarg is not None:
            self.index[kwargs[self.index_by_kwarg]] = hook
        self.latest = hook
        return render_function(*args, **kwargs)
    return wrapper