Thanks for the question. You can convert the functional component to a class component, or you can use lifecycle methods with a functional component via hooks. I will write more about this in the future.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You said that we can use componentDidMount in class component only ,so How can we use these lifecycles in function componenets???
Thanks for the question. You can convert the functional component to a class component, or you can use lifecycle methods with a functional component via hooks. I will write more about this in the future.