React Hooks are the functions which "hook into" React state and lifecycle features from function components. Hooks allows you to manipulate state and other React feature without writing a class. Let's talk about widely used hook
useEffect hook at a glance π§΅ππ»
useEffect hook is the heart of React functional components
If you're familiar with class components then you might know that we have various lifecycle methods but in functional components, we don't have any lifecycle methods. Instead we have a powerful hook called useEffect
By using useEffect, you tell React that your component needs to do something after render. React will remember the function you passed (we'll refer to it as our βeffectβ), and call it later after performing the DOM updates
Have you heard the term "Tooltip" in web development?
Tooltips guide your visitors to take action and hence provides extra layer of guidance without any difficulties and hence increase the user experience
Let's create a tooltip using HTML and CSS only π§΅ππ»
We just need to create an element that we will be visible only when user moves the mouse pointer over an elment
STEP1: Let's start with the HTML structure
STEP2: Popup text
- Add some width and padding
- Hide the popup element throughout and show it only on hover
- Place it above the element
- Add little transition for smooth rendering