What do react hooks do / mean?

1.04K views

Currently new to React.js and I have no idea what lifecycle methods like ComponentDidMount or ComponentWillMount does. The only thing that I understand is that render() is when a component is inserted into the web DOM.

A basic explanation of the most common React lifecycles and when they manipulate data would be highly appreciated!

Edit: changed hooks to lifecycle methods.

In: Technology

Anonymous 0 Comments

Note on terminology: You’re not talking abotu React hooks. You’re talking about react lifecycle methods. (React hooks are newer and can let you do what lifecycle methods did).

Anyway, the best source is usually going to be the docs for React. Here is the docs for [React.Component](https://reactjs.org/docs/react-component.html#overview) which explains all the lifecycle methods. There’s also this [handy graph](http://projects.wojtekmaj.pl/react-lifecycle-methods-diagram/) for a summary of the common lifecycle methods.

Also you’d probably get better help on /r/learnjavascript or /r/reactjs than on elif.