The API docs for OnAfterRender say that it is "invoked after each time the component has been rendered", but it doesn't get called at all as part of prerendering. The proposal is to update the API doc to say that it is only invoked after an interactive render.