Note 1: While React team didn't deprecate or has no plan to do so as of now. They seems more focused on functional approach which is more up to date. It's better to prefer functional approach over class one. We are going to do the same here as well.
Note 2: React component lifecycle events are only available in class components. This topic is added only to provide a brief overview on how react works under the hood.