Simple Data Fetching in React with the Fetch API and Axios with Hooks UseEffect and UseState- Beginner Guide :)

Kirti K
Geek Culture
Published in
7 min readJun 2, 2021

--

In this tutorial, we’ll be learning Simple Data Fetching in React with the Fetch API and Axios with React- Hooks (useEffect and useState)

Fetch API , Data Fetching , React Hooks , UseState and UseEffect , Axios

Before we start please find below the important definitions:

Hooks Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class.

a) useState : is the first “Hook” and TheState Hookis a Hook that lets you add React state to function components

b) useEffect : The Effect Hook lets you perform side effects in function components:

Side Effects ???” — Data fetching, setting up a subscription, and manually changing the DOM in React components are all examples of side effects :)

Hooks are:

Completely opt-in.

100% backward-compatible.

Available now. Hooks are now available with the release of v16.8.0.

Please follow the below link for more details about useEffect and useState

--

--

Kirti K
Geek Culture

Kind is cool & share your knowledge 👋 👋 A seasoned front-end developer with over 15 years of experience crafting immersive digital experiences.