Skip to content

Commit 40cfd78

Browse files
committed
afterRenderEffect: afterEveryRender/afterNextRender
@JohannesHoppe
1 parent 78007cf commit 40cfd78

File tree

1 file changed

+4
-5
lines changed
  • blog/2024-11-effect-afterrendereffect

1 file changed

+4
-5
lines changed

blog/2024-11-effect-afterrendereffect/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Reactive Angular: Mastering effect and afterRenderEffect'
33
author: Johannes Hoppe
44
55
published: 2024-11-14
6-
lastModified: 2025-06-17
6+
lastModified: 2025-06-18
77
keywords:
88
- Angular
99
- JavaScript
@@ -226,11 +226,10 @@ like measuring element dimensions, directly managing animations, or orchestratin
226226

227227
The new `afterRenderEffect()` function allows us to control when specific tasks are executed during the DOM update process.
228228
The API itself mirrors the functionality of
229-
* [`afterRender`](https://next.angular.dev/api/core/afterRender) *(registers a callback to be invoked each time the application finishes rendering)* and
230-
* afterNextRender *(registers callbacks to be invoked the next time the application finishes rendering, during the specified phases.)*
229+
* [`afterEveryRender`](https://angular.dev/api/core/afterEveryRender) *(register callbacks to be invoked each time the application finishes rendering, during the specified phases.)* and
230+
* [`afterNextRender`](https://angular.dev/api/core/afterNextRender) *(register callbacks to be invoked the next time the application finishes rendering, during the specified phases.)*.
231231

232-
The `afterRender` function no longer exists since Angular 20.
233-
Even before that, the documentation recommended specifying explicit phases with `afterNextRender` to avoid significant performance losses.
232+
The documentation recommends specifying explicit phases with `afterNextRender` to avoid significant performance losses.
234233
There is a similar recommendation for `afterRenderEffect()`: There is one signature that is intended for use and another that exists but is not recommended.
235234

236235
However, there is one big difference between the hook methods and the new `afterRenderEffect()`:

0 commit comments

Comments
 (0)