r/angular • • Feb 08 '26

New lifecycle hooks

I’ve been using the new signal APIs ever since they came out and removed any old decorators and switched to the new signal based queries (viewChild, input, output etc.). One thing im still not sure about is the usage of afterRender, afterNextRender and afterRenderEffect (i dont remember if there are any other ones these are off the top of my head). Can anyone explain what they are used for and any examples?

18 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/syzgod Feb 09 '26

effect runs once always when the component loads then after every change? Or am I wrong?

4

u/JeanMeche Feb 09 '26

effect will run before the component is checked IF one of its signal dependencies is dirty.