Basic Iq
Basic Iq
React Basics
What is React?
React is a JavaScript library for building fast and interactive user interfaces. It makes web
development easier by using reusable components.
• Vanilla JavaScript updates the page by directly modifying the real DOM, which is
slow.
• React uses a Virtual DOM, updating only the changed parts, making it faster.
• Example:
• Virtual DOM is a copy of the real DOM that React updates first.
• Instead of updating the whole webpage, React updates only the changed elements,
making it faster.
What is the difference between Real DOM and Virtual DOM?
• useReducer → Used when state logic is complex (like a counter with many actions).
• Use useNavigate().