React Native

Performance Optimization

FlatList optimization, memo, useMemo/useCallback, Hermes, profiling, bundle size

24 питань зі співбесід·
Senior
1

What is the main role of React.memo in React Native performance optimization?

Відповідь

React.memo is a Higher-Order Component that memoizes the render result of a functional component. It prevents unnecessary re-renders by comparing current props with previous ones (shallow comparison by default). If props haven't changed, React reuses the memoized result instead of re-rendering the component, which significantly improves performance in lists or complex component trees.

2

Which FlatList property significantly optimizes scrolling by providing item dimensions in advance?

Відповідь

getItemLayout is an optional FlatList property that allows pre-calculating the height, width, and offset of each item. This prevents React Native from dynamically measuring each item, which considerably improves scroll performance, especially when jumping to a specific index with scrollToIndex. This optimization is particularly useful when all items have the same size.

3

What is the main difference between useMemo and useCallback in terms of optimization?

Відповідь

useMemo memoizes the result of an expensive calculation and returns that computed value, while useCallback memoizes a function itself and returns that function. useMemo is useful for avoiding heavy recalculations on each render, whereas useCallback is essential for avoiding recreating functions passed as props to memoized child components, which would break their React.memo optimization.

4

What is Hermes and what is its main advantage for React Native applications?

5

Why is it crucial to provide a stable keyExtractor function to FlatList?

+21 питань зі співбесід

Інші теми співбесід React Native

JavaScript Essentials

Junior
25 запитань

React Fundamentals

Junior
20 запитань

React Native Basics

Junior
22 запитань

React Hooks

Junior
20 запитань

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 запитань

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 та симуляторів співбесід.

Почни безкоштовно