React Hooks | useEffect | ReactJS tutorial

preview_player
Показать описание
Learn React Hooks!

In this video, we will look at the "useEffect" React Hook so you understand how to use it in your code today. useEffect is one of the core hooks and essential knowledge for any React JS developer. With useEffect we can trigger actions when our state changes, our component mounts, add and clean up event listeners.

With useEffect we replace all of the lifecycle methods we used to have in ReactJS so you can say goodbye to componentDidMount, componentDidUpdate, componentWillUnmount, shouldComponentUpdate, getDerivedStateFromProps and getSnapshotBeforeUpdate. This has great simplified the workflow in React!

My favourite thing about useEffect is not having to remember all of those lifecycle methods 🎉

🔗 Link to code:

📚The official React docs on useEffect

💜 Subscribe for more videos 💜

Follow Niall Maher

#programming #reactjs
Рекомендации по теме
Комментарии
Автор

11:20, Line number 10 event.clientX. clientX means?

mohammadriajuddin
Автор

Hey mate, great video! I've found the useState and useEffect videos really useful and well presented. I'm becoming more familiar with how each of these Hooks work, but trying to figure out the best method to use them to render a new div in the centre of the page. For example, I click a link which "takes me to a new page" within my app, but really it just renders a different component within the same div. Is that the best method for rendering a new page in React? Hopefully that makes sense, if not it's because I'm slightly confused haha.
Thanks!

rhow
Автор

Great video! very clear on how useEffect works and it's uses!

MrKieranthompson
welcome to shbcf.ru