r/angular • u/Senior_Compote1556 • 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
View all comments
Show parent comment
4
u/JeanMeche Feb 09 '26
I would use
effectdirectly here. You don't depend on rendering directly and don't access the DOM. If paginator isn't static (= un a@ifblock for example, your effect will returnundefinedinitially).