Photo by Luca Bravo on Unsplash

You have already heard about APIS and we need to integrate APIs with a frontend to call data from servers.

In modern react we use the useEffect hook to fetch data from API.

useEffect hook is used to fetch data, or manually changing the DOM in React components.

In the above example, we are changing in DOM after clicking on the count button by changing variable by count+1

Inside teh useEffect hook we call a function called fetch(url) with parameter of the api link we want to fetch data from

Here we are fetching articles from the local…


Photo by Joshua Aragon on Unsplash

All are switching to modern Reactjs i.e Reactjs that works with functional components and when we work with components we need to manage the state, To manage the state we use Hook, A Hook is a special function that lets you “hook into” React features.

What is useState ?

useState is a Hook that lets you add React state to function components. we can use useState to update the data after a particular event.

useState hook needs to be imported from react as below

How it is used?

It is generally used in a destructured manner where we have a current state here as count and second…


Photo by Chris Yang on Unsplash

Yes, you guess it right, a function without a name is called an anonymous function. But Do you know how to use it, where to use it?

I know you are here to find these answers,

Let's Dive into it!

Why we use the anonymous function?

The anonymous function is generally used for two reasons

  1. If you want to call a function just once.
  2. If you want to call a function with the argument on a particular event example: on click event

I know you are still not clear with anything, Let's code now with a problem in mind!!

Problem

If we want to call a function…


Pic Credit : Vishnu Mohanan

Reactjs is widely used for its easy making reusable components which can be used with dynamic data as well

In simple language, a component is a piece of code that can be used anywhere in the application just by writing it once and reusing it as many times as required.

Step 1

Make a folder name component as given below and initialize component file name with .js extension. For example, I am using ReusableComponent.js

Note: Make a component folder inside the src folder else you will not able to call the component it will throw an error


You cannot react “haha” in react js , Just kidding! In the front-end development field react is one of the most demanding and hot tech requirement which is highly getting adapted by startups

As you can build a spa (single page application) in React you can easily switch to mobile app development later with ease.

Community supports

React have a large community on Github,Reddit,Twitter and many other social media platform, errors and bugs can be easily solved here as someone has already solved it for you

As it backed by facebook the community support from Facebook developers solves almost every problem you…

Website and Mobile App developer (React JS) l Portfolio: www.thebrandwick.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store