Get item from an API using React hooks – UseEffect
Get a randomly generated Brewdog beer, API (read more)
In this tutorial, I am going to show you how to make an API call to punkapi’s extensive brew dog catalog API! I have put a link to the website below if you want to check it out. I can see they have noted here the API is not for commercial use, so if you are using it for a personal project or coding along with me, you should be fine!
For this project, we will be using react hooks, mainly focusing on ‘useEffect’. If you’re familiar with React class lifecycle methods, you can think of the ‘useEffect’ Hook as ‘componentDidMount’, ‘componentDidUpdate’, and ‘componentWillUnmount’ combined.
If you need help setting up your project to use React, please head over to this video before proceeding with this tutorial: https://www.youtube.com/watch?v=G76SICBNSfs
JSONView extension: https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc
I would love to see what you made so please tag me on twitter on @ania_kubow or mention me on Youtube so I can find it and see 🙂
? In most videos I use Tabnine as my A.I autocompletion tool. You can download it for free here: http://bit.ly/tabnine-top-tool
? You can get a blockchain domain with my affiliate link here: http://bit.ly/get-a-crypto-domain
? If you would like to buy me a coffee, well thank you very much that is mega kind! : https://www.buymeacoffee.com/aniakubow
? Sign up for weekly coding tips from my newsletter partnership: https://bit.ly/JS-tips
You can also find me on: