Hooks mainly used to provide state, lifecycle methods and all other features in functional component that we generally get in a class component. But also makes it easier to apply.

Where to use

Hooks are mainly used in react functional components. Because functional components are stateless and hooks provide us facility to use most of the react features in them.

Why we prefer hooks

To understand this we should first understand why we use functional component because ultimately they are used inside functional components.

benefits of using functional component

  • It avoids unnecessary use of inheritance that we generally use in…

The spread operator is awesome. It can do so much — it’s efficient, readable, and can save a whole load of mess. I have used this many times.

After release of ES6 and the Babel, writing JavaScript has become incredibly dynamic, from new language syntax to custom parsing like JSX. I’ve become a big fan of the spread operator, three dots that may change the way you complete tasks within JavaScript.

So, What Actually is the Spread Operator?

Spread Operator represented by Three dots: ...

Three very powerful dots, that allow you to expand arrays or iterable objects in places…


CSS selectors are the ways by which we select the HTML elements and style them. These HTML elements may be either single or in groups, either adjacent or in different places.

These selectors are basically divided into 4 categories:

  1. Simple Selectors

2. Combinators Selectors

3. pseudo-class

4. pseudo-element

Simple Selectors: It selects html elements based on the id, class and tag.

Id: The #id selector styles the element based on the id attribute provided to HTML elements.

e.g. #firstname Selects the element with id=”firstname”

id selector

Class: The .class selector selects elements based on the class attribute provided to HTML elements.

e.g…

Pooja Daharwal

UI Developer @HCL Technologies

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