React Hooks: Part 1
If you’ve written React class components before, you should be familiar with lifecycle methods like `componentDidMount`, `componentDidUpdate`, and `componentWillUnmount`. The `useEffect` Hook is all three of these lifecycle methods combined. I
I would like to start with why and how I got into writing. Actually, I hate or never put in the time to write something, I mean, I don't like writing. ✍️ I was trying to write diaries, but it never became a habit. After that, I needed to write a tutorial for a hackathon, and I really got into it and wanted to submit the project.
In this tutorial, we will create a React Weather App and use React's latest hooks. At the end of this tutorial, you will have knowledge about React's most common hooks and how to create a custom hook. You can see the application that we will create in this tutorial.
For the first part of the project, we have used `useState` hook, fetched our data and console logged the data for any city typed by the user. Before we continue, we need to remove some of the code from the last part to be able to use our custom hook. Let's go inside our `CitySelector` component and remove `onSearch` function, also remove the `results` state