In React, lifecycle methods are special methods in class components that get called at different stages of a component’s life.
In React, a controlled component is a form element whose value is controlled by React state.
That means:
-
React state becomes the single source of truth
-
The input value is stored in
state -
Every change in the input updates the state using
onChange
Prop drilling happens when data is passed from a parent component to deeply nested child components through multiple intermediate components using props, even when those intermediate components do not need the data themselves.
Lifting state up means:
Moving state from child components to their closest common parent component so multiple components can share and synchronize the same data.
But in real applications, child components also need to communicate back to their parents — for example when a button is clicked, form data changes, or an item is selected.
In React, data flows in one direction — from the parent component to child components through props.
This is called one-way data binding or unidirectional data flow.
Props stands for Properties.
They are used to pass data from one component to another, usually from parent → child.
Think of props like function parameters.
Babel is a JavaScript transpiler that converts modern JavaScript and JSX code into browser-compatible JavaScript.
React browsers do not understand JSX directly, so Babel transforms it into normal JavaScript that browsers can execute.
In React, components can be created in two ways:
-
Functional Components
-
Class Components
Today, functional components are the recommended approach because of Hooks.
The Virtual DOM (VDOM) is a lightweight JavaScript representation of the actual browser DOM.
Instead of directly updating the real DOM whenever state changes, React first updates the Virtual DOM, compares it with the previous version, and then updates only the changed parts in the real DOM.
