React Flashcards

(6 cards)

1
Q

What is React used for?

A

React is a JavaScript library used for building user interfaces, primarily for web applications. It helps developers create interactive, dynamic, and reusable UI components efficiently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the advantages and disadvantages of Virtual DOM?

A

Advantages:
1. Performance Optimization
2. Declarative UI Updates
3. Cross-Platform Consistency
4. Simplifies Programming Model

Disadvantages:
1. Extra Abstraction Overhead
2. Initial Learning Curve
3. Memory Consumption
4. Not a Silver Bullet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Are TSX and JSX the same?

A

No, TSX is the TypeScript equivalent of JSX.

JSX is a syntax extension for JavaScript that allows you to write HTML-like markup inside JavaScript.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do props work in React?

A

Props (short for properties) in React are a way to pass data from a parent component to a child component.

  1. Props are read-only in the child component — the child cannot modify them.
  2. Passed as attributes on a JSX element.
  3. Accessible inside the child component via a parameter (usually an object).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Hooks in React?

A

Hooks in React are special functions that let you “hook into” React features like state and lifecycle methods inside functional components, without needing to write class components.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is NextJS used for?

A

Next.js is a React framework used to build production-ready web applications with powerful features out of the box.

  1. Server-Side Rendering (SSR)
  2. Static Site Generation (SSG)
  3. API Routes
  4. File-Based Routing
  5. Built-In CSS and Image Optimization
  6. Fast Refresh & Developer Experience
How well did you know this?
1
Not at all
2
3
4
5
Perfectly