You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -224,12 +227,11 @@ like measuring element dimensions, directly managing animations, or orchestratin
224
227
The new `afterRenderEffect()` function allows us to control when specific tasks are executed during the DOM update process.
225
228
The API itself mirrors the functionality of
226
229
*[`afterRender`](https://next.angular.dev/api/core/afterRender)*(registers a callback to be invoked each time the application finishes rendering)* and
227
-
*[`afterNextRender`](https://next.angular.dev/api/core/afterNextRender)*(registers callbacks to be invoked the next time the application finishes rendering, during the specified phases.)*
228
-
229
-
which are both in **Developer Preview**!
230
+
* afterNextRender *(registers callbacks to be invoked the next time the application finishes rendering, during the specified phases.)*
230
231
231
-
The Angular documentation recommends avoiding `afterRender` when possible and suggest specifying explicit phases with `afterNextRender` to avoid significant performance degradation.
232
-
You'll see a similar recommendation for `afterRenderEffect()`. There is one signature that is intended for use and another that exists but is not recommended.
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.
234
+
There is a similar recommendation for `afterRenderEffect()`: There is one signature that is intended for use and another that exists but is not recommended.
233
235
234
236
However, there is one big difference between the hook methods and the new `afterRenderEffect()`:
235
237
> **💡 Values are propagated from phase to phase as signals instead of as plain values.**
@@ -516,13 +518,10 @@ Last but not least, the third link provides an interactive demo on StackBlitz, w
516
518
517
519
## Conclusion
518
520
519
-
Angular's new `effect()` API opens up new possibilities for reactive state management and `afterRenderEffect()` provides efficient DOM manipulation when needed.
520
-
By understanding when to use each API, developers can create responsive and powerful Angular applications with a clean new syntax.
521
-
522
-
> **⚠️ Please note that both APIs are in Developer Preview and may still be subject to change!**
523
-
524
-
But time flies by anyway.
525
-
Why not try `effect()` and `afterRenderEffect()` in your Angular project today and see how they simplify your state management and DOM interactions, it certainly will not take much time until the APIs are stable!
521
+
Both APIs open up new, elegant ways of state and DOM management in Angular: reactive, precise and clear.
522
+
Those who familiarise themselves with `effect()` and `afterRenderEffect()` at an early stage will benefit today from the architecture of tomorrow.
523
+
Take the opportunity to try out the new interfaces in your application!
524
+
The functions have been considered **stable** since Angular 20.
0 commit comments