React Native

React Fundamentals

JSX, components, props, state, events, conditional rendering, lists & keys

20 câu hỏi phỏng vấn·
Junior
1

What is JSX in React?

Câu trả lời

JSX is a syntactic extension of JavaScript that allows writing HTML-like code directly within JavaScript. It gets transpiled into React.createElement() function calls by tools like Babel. JSX makes the code more readable and facilitates UI creation by combining logic and rendering in the same file.

2

How to include a JavaScript expression in JSX?

Câu trả lời

JavaScript expressions are included in JSX by wrapping them in single curly braces. For example, to display a variable name, write {name}. This syntax allows injecting dynamic values, calling functions, or evaluating expressions directly in the component rendering.

3

What is the main difference between a functional component and a class component in React?

Câu trả lời

A functional component is a simple JavaScript function that returns JSX, while a class component extends React.Component and uses a render() method. Since the introduction of Hooks in React 16.8, functional components can handle state and side effects, making class components less necessary in modern projects.

4

What is a prop in React?

5

What is state in React and how does it differ from props?

+17 câu hỏi phỏng vấn

Nắm vững React Native cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí