T
T
t800zippygod2020-08-03 17:53:45
React
t800zippygod, 2020-08-03 17:53:45

How is adding a lifecycle implemented in functional React components?

I would be grateful if someone could explain on the fingers how adding a life cycle to functional components in React works. Including how the React.useEffect and React.useState hooks are implemented. It is interesting exactly what patterns are used, what is remembered where and from where it is called.
And is it worth using such functional components with a life cycle, or is it already easier to create a class: which is more profitable in terms of memory?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur Kostenko, 2020-08-04
@t800zippygod

Look here https://www.netlify.com/blog/2019/03/11/deep-dive-... it's well explained here, for performance here https://medium.com/@maafaishal/react-class- compone...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question