React Basics Flashcards
1
Q
What is JSX?
A
JSX stands for JavaScript XML. It allows developers to write HTML-like code inside JavaScript, making it easier to create React components.
2
Q
How does React differ from vanilla JavaScript or jQuery when updating the DOM?
A
React uses a virtual DOM. When state or props change, it creates a virtual update and then efficiently updates the real DOM only where changes occurred.
3
Q
What are the key differences between class components and functional components in React?
A
Class components have lifecycle methods and can have state, while functional components are simpler and can utilize hooks for state and side effects.