Endava interview question

What are react lifecycle methods and how do they work?