React Flashcards
What is React?
React is a JavaScript library for building user interfaces, primarily using components to manage the UI efficiently.
What is JSX?
JSX is a syntax extension for JavaScript that allows you to write HTML-like code within JavaScript files.
What is a React Component?
A React component is a reusable piece of UI, defined as either a function or a class, that returns JSX.
What are props in React?
Props (short for properties) are immutable inputs passed from parent to child components to configure or display data.
What is state in React?
State is a mutable object managed within a component to track dynamic data or UI changes.
What is the Virtual DOM?
The Virtual DOM is a lightweight representation of the real DOM that React uses to optimize UI updates.
What is useState in React?
useState is a React Hook that lets you add state to functional components.
What is useEffect in React?
useEffect is a React Hook for handling side effects like data fetching, subscriptions, or DOM updates in functional components.
What is React’s key attribute?
The key attribute helps React identify which items have changed, are added, or are removed, optimizing list rendering.
What is the difference between controlled and uncontrolled components?
Controlled components are managed by React state, while uncontrolled components rely on the DOM for their state.