Is there any way besides methods like componentDidmount? componentDidUpdate? componentWillMount? in react?
You can try useEffect in React Hook
Yes, as stated below, useEffect is another equivalent and any function passed w/ useEffect is ran each time the component is rendered - unless you have a second argument being passed. If the second argument is an empty array it will behave like componentDidMount.
Also check this out: https://react-hooks-cheatsheet.com/useeffect
Sources: https://stackoverflow.com/questions/53945763/componentdidmount-equivalent-on-a-react-function-hooks-component#:~:text=There's no componentDidMount on functional,read the documentation on useEffect .