React Native

React Hooks

useState, useEffect, useContext, useRef, useCallback, useMemo, custom hooks

20 คำถามสัมภาษณ์·
Junior
1

Which function allows declaring a state variable in a React functional component?

คำตอบ

useState is the fundamental hook for managing local state in functional components. It returns an array containing the current state value and a function to update it. Unlike class components that use this.state, functional components use useState for each independent state variable.

2

What is the correct syntax to use useState with an initial value of 0?

คำตอบ

The useState syntax uses array destructuring. The first element is the current state value, the second is the setter function to update it. The naming convention is to prefix the setter with 'set' followed by the capitalized variable name, like setCount for the count variable.

3

When does the useEffect callback without a dependency array execute?

คำตอบ

Without a dependency array, useEffect runs after every render of the component, including the first render and all subsequent re-renders. This can cause performance issues as the code runs on every update. To limit executions, provide a dependency array specifying which values to watch.

4

How to run a useEffect only on component mount?

5

What is the purpose of the function returned by a useEffect?

+17 คำถามสัมภาษณ์

หัวข้อสัมภาษณ์ React Native อื่นๆ

JavaScript Essentials

Junior
25 คำถาม

React Fundamentals

Junior
20 คำถาม

React Native Basics

Junior
22 คำถาม

TypeScript for React & React Native

Junior
22 คำถาม

React Native Components & API

Junior
20 คำถาม

React Native Styling & Layout

Junior
18 คำถาม

React Native Navigation

Mid-Level
22 คำถาม

React Native State Management

Mid-Level
24 คำถาม

React Native Networking & API

Mid-Level
20 คำถาม

Data Persistence

Mid-Level
20 คำถาม

Forms & Validation

Mid-Level
18 คำถาม

React Native Animations

Mid-Level
22 คำถาม

Native Modules & Bridge

Mid-Level
20 คำถาม

Platform-Specific Code

Mid-Level
18 คำถาม

Permissions & Device APIs

Mid-Level
20 คำถาม

Push Notifications

Mid-Level
18 คำถาม

React Native Testing

Mid-Level
20 คำถาม

React Native Debugging

Mid-Level
18 คำถาม

Build & Deployment

Mid-Level
20 คำถาม

Expo vs React Native Bare

Mid-Level
18 คำถาม

Performance Optimization

Senior
24 คำถาม

Memory Management

Senior
20 คำถาม

Architecture Patterns

Senior
22 คำถาม

React Native New Architecture

Senior
24 คำถาม

Security Best Practices

Senior
20 คำถาม

Offline-First Architecture

Senior
20 คำถาม

React Native CI/CD

Senior
20 คำถาม

Monorepo & Code Sharing

Senior
18 คำถาม

Advanced Topics

Senior
22 คำถาม

App Lifecycle & Background Execution

Mid-Level
20 คำถาม

Authentication & Session Management

Mid-Level
22 คำถาม

Monitoring & Crash Reporting

Senior
20 คำถาม

เชี่ยวชาญ React Native สำหรับการสัมภาษณ์ครั้งถัดไป

เข้าถึงคำถามทั้งหมด flashcards แบบทดสอบเทคนิค แบบฝึกหัด code review และตัวจำลองสัมภาษณ์

เริ่มใช้ฟรี