Popular Searches
Popular Course Categories
Popular Courses

Top 50 React Native Interview Questions and Answers for Developers

What Our Students Say
React Native Interview Questions and Answers

Prepare for your mobile app developer interview with the most important React Native interview questions and answers covering basic to advanced concepts.

1. What is React Native?

React Native is an open-source framework developed by Meta (Facebook) that allows developers to build mobile applications using JavaScript and React.

It helps developers create Android and iOS apps using a single codebase, which saves time and effort.

Unlike traditional mobile development where you write:

Java/Kotlin for Android

Swift/Objective-C for iOS

React Native lets you write code using JavaScript and React components.

Key Features

Cross-platform development

Reusable components

Hot Reloading

Large community support

Faster development

Example

import React from 'react';
import { Text, View } from 'react-native';

export default function App() {
  return (
    <View>
      <Text>Hello React Native</Text>
    </View>
  );
}

In this example:

View works like a container

Text displays text on the screen

2. What are the advantages of React Native?

React Native provides many benefits for mobile app development.

1. Cross-Platform Development

One codebase can run on both Android and iOS.

2. Faster Development

Developers can reuse components and write less code.

3. Hot Reloading

Changes in code appear instantly without restarting the app.

4. Strong Community Support

Many developers and libraries are available.

5. Cost Effective

Companies can build apps for two platforms with one team.

3. What are the limitations of React Native?

Even though React Native is powerful, it has some limitations.

1. Performance Issues

For complex applications like heavy gaming, native development performs better.

2. Native Modules Needed

Sometimes developers must write native code (Java, Kotlin, Swift).

3. Third-Party Dependency

React Native relies heavily on external libraries.

4. Large App Size

Apps built with React Native can sometimes be larger in size.

4. What is the difference between ReactJS and React Native?

Both technologies are developed by Meta, but they are used for different purposes.

FeatureReactJSReact Native
PlatformWeb ApplicationsMobile Applications
ComponentsHTML elementsNative components
RenderingUses DOMUses Native APIs
StylingCSSJavaScript styles

5. What are components in React Native?

Components are the building blocks of a React Native application.

They define how the UI should appear and behave.

Two Types of Components

1. Functional Components

Simpler and commonly used.

function Welcome() {
  return <Text>Hello User</Text>;
}

2. Class Components

class Welcome extends React.Component {
  render() {
    return <Text>Hello User</Text>;
  }
}

Most modern React Native apps use functional components with hooks.

6. What is JSX in React Native?

JSX (JavaScript XML) is a syntax used to write UI code in React Native.

It allows developers to write HTML-like code inside JavaScript.

Example:

const App = () => {
  return (
    <View>
      <Text>Welcome to React Native</Text>
    </View>
  );
};

Here:

  • View acts like a container
  • Text shows content

JSX makes UI code more readable and easier to write.

7. What is the View component in React Native?

View is the most basic component in React Native.

It works like a container or div element in HTML.

It is used to:

  • Group components
  • Apply layout
  • Apply styling

Example

import { View, Text } from 'react-native';

function App() {
  return (
    <View>
      <Text>Hello World</Text>
    </View>
  );
}

View supports flexbox layout, styling, touch handling, and accessibility features.

8. What is the Text component in React Native?

The Text component is used to display text inside a mobile application.

Unlike HTML, React Native does not allow plain text outside the Text component.

Example

import { Text } from 'react-native';

export default function App() {
  return (
    <Text>Hello React Native Developer</Text>
  );
}

Text component also supports:

  • Styling
  • Nested text
  • Click events

9. What is StyleSheet in React Native?

React Native does not use CSS.
Instead, it uses JavaScript objects for styling.

The StyleSheet API helps organize styles efficiently.

Example

import { StyleSheet, Text, View } from 'react-native';

export default function App() {
  return (
    <View style={styles.container}>
      <Text style={styles.text}>Hello Developer</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    backgroundColor: 'lightblue',
    padding: 20
  },
  text: {
    fontSize: 18
  }
});

Benefits:

  • Better performance
  • Organized styling
  • Reusable styles

10. What is Flexbox in React Native?

Flexbox is a layout system used to design responsive layouts.

React Native uses Flexbox by default.

Important Flexbox Properties

PropertyDescription
flexControls size of component
flexDirectionRow or column layout
justifyContentAlign items horizontally
alignItemsAlign items vertically

Example

<View style={{
  flex: 1,
  flexDirection: 'row',
  justifyContent: 'center',
  alignItems: 'center'
}}>
  <Text>Item 1</Text>
  <Text>Item 2</Text>
</View>

This will align elements center horizontally and vertically.

11. What are Props in React Native?

Props (Properties) are used to pass data from a parent component to a child component.

Props are read-only, which means the child component cannot change them.

They help make components reusable and dynamic.

Example

import React from "react";
import { Text, View } from "react-native";

const Greeting = (props) => {
  return <Text>Hello {props.name}</Text>;
};

export default function App() {
  return (
    <View>
      <Greeting name="Rajan" />
      <Greeting name="Developer" />
    </View>
  );
}

Explanation

Here:

  • Greeting is a child component.
  • name is passed as a prop from the parent.

The output will display different greetings.

12. What is State in React Native?

State is used to store dynamic data inside a component.

When the state changes, the component automatically re-renders (updates the UI).

State is mainly used for:

  • Form inputs
  • Counters
  • User interaction
  • API data

Example

import React, { useState } from "react";
import { Text, Button, View } from "react-native";

export default function App() {
  const [count, setCount] = useState(0);

  return (
    <View>
      <Text>Count: {count}</Text>
      <Button title="Increase" onPress={() => setCount(count + 1)} />
    </View>
  );
}

Explanation

  • useState(0) initializes the state.
  • count stores the value.
  • setCount updates the state.

When the button is clicked, the UI updates automatically.

13. What are Hooks in React Native?

Hooks are special functions that allow functional components to use state and lifecycle features.

Before hooks, these features were available only in class components.

Common Hooks

HookPurpose
useStateManage state
useEffectHandle side effects
useContextManage global data
useRefAccess DOM elements

Example

import React, { useState } from "react";
import { Text, Button, View } from "react-native";

export default function App() {
  const [name, setName] = useState("Rajan");

  return (
    <View>
      <Text>{name}</Text>
      <Button title="Change Name" onPress={() => setName("Developer")} />
    </View>
  );
}

Hooks make components simpler and easier to manage.

14. What is useEffect in React Native?

useEffect is a React Hook used to perform side effects.

Side effects include:

  • API calls
  • Data fetching
  • Timers
  • Event listeners

Example

import React, { useEffect } from "react";
import { Text } from "react-native";

export default function App() {

  useEffect(() => {
    console.log("Component Mounted");
  }, []);

  return <Text>Hello React Native</Text>;
}

Explanation

useEffect() runs after the component renders.

[] means it runs only once when the component mounts.

15. What is React Navigation?

React Navigation is a library used to move between screens in a React Native app.

For example:

  • Login screen
  • Dashboard screen
  • Profile screen

React Navigation helps manage screen transitions.

Installation

npm install @react-navigation/native

Example

navigation.navigate("Profile");

Types of Navigation

  1. Stack Navigation
  2. Tab Navigation
  3. Drawer Navigation

16. What is Stack Navigation?

Stack Navigation works like a stack of screens.

When a new screen opens, it is placed on top of the stack.

Example:

Home Screen
   ↓
Profile Screen
   ↓
Settings Screen

Users can go back to the previous screen.

Example

navigation.navigate("Profile");

This pushes the Profile screen on top of the stack.

17. What is AsyncStorage in React Native?

AsyncStorage is used to store data locally on the user's device.

It works like localStorage in web applications.

It is useful for storing:

  • Login tokens
  • User preferences
  • App settings

Example

import AsyncStorage from '@react-native-async-storage/async-storage';

await AsyncStorage.setItem('username', 'Rajan');

const value = await AsyncStorage.getItem('username');

Features

  • Persistent storage
  • Asynchronous
  • Simple key-value storage

18. How do you call an API in React Native?

React Native can fetch data from APIs using:

  • fetch()
  • axios

Most developers use Axios because it is easier.

Example using Fetch

useEffect(() => {
  fetch("https://jsonplaceholder.typicode.com/posts")
    .then(response => response.json())
    .then(data => console.log(data));
}, []);

Example using Axios

import axios from "axios";

axios.get("https://jsonplaceholder.typicode.com/posts")
  .then(res => console.log(res.data));

API calls are usually placed inside useEffect.

19. What is Redux in React Native?

Redux is a state management library used to manage global state in large applications.

It helps different components share data easily.

Example:

  • User login data
  • Shopping cart
  • Theme settings

Redux Flow

Component → Action → Reducer → Store → Component

Benefits

  • Centralized data management
  • Predictable state updates
  • Better debugging

20. What is the difference between State and Props?

FeatureStateProps
DefinitionLocal component dataData passed from parent
MutableYesNo
Controlled byComponent itselfParent component
PurposeDynamic dataComponent communication

Example

<Profile name="Rajan" />

Here:

  • name is a prop
  • It comes from the parent component

21. What is ScrollView in React Native?

ScrollView is a component used to display a scrollable view of content.

If the content is larger than the screen size, the user can scroll vertically or horizontally.

Features

  • Displays all items at once
  • Supports vertical and horizontal scrolling
  • Good for small lists

Example

import React from "react";
import { ScrollView, Text } from "react-native";

export default function App() {
  return (
    <ScrollView>
      <Text>Item 1</Text>
      <Text>Item 2</Text>
      <Text>Item 3</Text>
      <Text>Item 4</Text>
      <Text>Item 5</Text>
    </ScrollView>
  );
}

Important

ScrollView renders all components at once, which can affect performance for large lists.

22. What is FlatList in React Native?

FlatList is used to display large lists of data efficiently.

Unlike ScrollView, it renders items lazily (only when needed).

Advantages

  • Better performance
  • Efficient memory usage
  • Supports pagination
  • Supports pull-to-refresh

Example

import React from "react";
import { FlatList, Text, View } from "react-native";

export default function App() {

  const data = [
    { id: "1", name: "Item 1" },
    { id: "2", name: "Item 2" },
    { id: "3", name: "Item 3" }
  ];

  return (
    <FlatList
      data={data}
      keyExtractor={(item) => item.id}
      renderItem={({ item }) => (
        <View>
          <Text>{item.name}</Text>
        </View>
      )}
    />
  );
}

FlatList is commonly used for:

  • Product lists
  • Chat messages
  • Social media feeds

23. What is the difference between ScrollView and FlatList?

FeatureScrollViewFlatList
RenderingRenders all itemsRenders only visible items
PerformancePoor for large listsOptimized for large lists
Memory usageHighLow
Use caseSmall listsLarge lists

Example

Use ScrollView when you have 10–20 items.

Use FlatList when you have 100+ items.

24. What is Expo in React Native?

Expo is a tool that makes React Native development easier and faster.

It provides many pre-built APIs and tools.

Developers can build apps without writing native code.

Features of Expo

  • Easy project setup
  • Built-in camera, sensors, and notifications
  • Fast development
  • Works with Expo Go app

Create Expo Project

npx create-expo-app myApp

Expo is ideal for beginners and small projects.

25. What is the difference between React Native CLI and Expo?

FeatureReact Native CLIExpo
SetupComplexEasy
Native code accessFull accessLimited
PerformanceBetterSlightly lower
Learning curveHarderEasier

When to Use

Use Expo:

  • Beginner projects
  • Faster development

Use React Native CLI:

  • Large applications
  • Need custom native modules

26. What is the use of the Image component?

The Image component is used to display images in a React Native application.

Images can come from:

  • Local files
  • Internet URLs

Example

import React from "react";
import { Image } from "react-native";

export default function App() {
  return (
    <Image
      source={{ uri: "https://reactnative.dev/img/tiny_logo.png" }}
      style={{ width: 100, height: 100 }}
    />
  );
}

Local Image Example

<Image source={require('./assets/logo.png')} />

27. What is Debugging in React Native?

Debugging means finding and fixing errors in the application.

React Native provides several debugging tools.

Debugging Tools

  • Chrome Developer Tools
  • React Native Debugger
  • Flipper
  • Console Logs

Example

console.log("User Data:", user);

Debugging helps developers identify issues quickly.

28. What are Native Modules in React Native?

Sometimes React Native cannot access device-specific features directly.

In such cases, developers create Native Modules.

Native modules allow React Native to communicate with:

  • Android (Java/Kotlin)
  • iOS (Swift/Objective-C)

Example Use Cases

  • Bluetooth access
  • Advanced camera features
  • Device sensors

Native modules bridge JavaScript with native code.

29. What is the Bridge in React Native?

The Bridge is a system that allows JavaScript code to communicate with native code.

React Native has three main parts:

  • JavaScript Thread
  • Native Thread
  • Bridge

Process

JavaScript → Bridge → Native Modules

Example:
When you press a button in React Native, the action may go through the bridge to native code.

30. How can you improve performance in React Native?

Performance optimization is important for large applications.

Best Practices

1. Use FlatList instead of ScrollView for large data

2. Avoid unnecessary re-renders

Use React.memo().

3. Optimize images

Use compressed images.

4. Use lazy loading

Load components only when needed.

5. Remove console logs in production

Too many logs slow down the app.

31. What is useRef in React Native?

useRef is a React Hook used to store a reference to a value or component without causing re-renders.

It is mainly used for:

  • Accessing UI elements
  • Storing mutable values
  • Managing focus

Example

import React, { useRef } from "react";
import { TextInput, Button, View } from "react-native";

export default function App() {
  const inputRef = useRef(null);

  const focusInput = () => {
    inputRef.current.focus();
  };

  return (
    <View>
      <TextInput ref={inputRef} placeholder="Enter text" />
      <Button title="Focus Input" onPress={focusInput} />
    </View>
  );
}

 

Explanation

  • useRef() creates a reference.
  • inputRef.current.focus() focuses the input field.

32. What is useContext in React Native?

useContext is a React Hook used to share data globally across components without passing props manually.

This helps avoid prop drilling.

Example

import React, { createContext, useContext } from "react";
import { Text } from "react-native";

const UserContext = createContext("Guest");

function Profile() {
  const user = useContext(UserContext);
  return <Text>User: {user}</Text>;
}

export default function App() {
  return (
    <UserContext.Provider value="Rajan">
      <Profile />
    </UserContext.Provider>
  );
}

Explanation

  • createContext() creates a global data container.
  • useContext() accesses that data.

33. What is Linking in React Native?

Linking is used to open external URLs or apps from a React Native application.

It can open:

  • Websites
  • Phone calls
  • Email apps
  • Other mobile apps

Example

import { Linking, Button } from "react-native";

export default function App() {
  return (
    <Button
      title="Open Website"
      onPress={() => Linking.openURL("https://google.com")}
    />
  );
}

Explanation

When the button is clicked, the device browser opens the website.

34. What is Deep Linking in React Native?

Deep Linking allows a user to open a specific screen inside an app using a URL.

Example:

myapp://profile

If a user clicks this link, it will open the Profile screen directly.

Uses

  • Marketing campaigns
  • Notifications
  • External app links

Deep linking improves user navigation and app engagement.

35. What is the use of the Touchable components?

Touchable components are used to handle user touch interactions.

Common Touchable components:

ComponentPurpose
TouchableOpacityChanges opacity when pressed
TouchableHighlightHighlights when pressed
TouchableWithoutFeedbackNo visual feedback
PressableModern touch handling component

Example

import { TouchableOpacity, Text } from "react-native";

export default function App() {
  return (
    <TouchableOpacity onPress={() => alert("Button Pressed")}>
      <Text>Click Me</Text>
    </TouchableOpacity>
  );
}

36. What is Pressable in React Native?

Pressable is a modern component used to handle press interactions.

It provides more control over press behavior.

Example

import { Pressable, Text } from "react-native";

export default function App() {
  return (
    <Pressable onPress={() => alert("Pressed!")}>
      <Text>Press Me</Text>
    </Pressable>
  );
}

Features

  • Detect press
  • Detect long press
  • Detect press in/out

37. What are Platform APIs in React Native?

React Native provides the Platform API to detect whether the app is running on Android or iOS.

This helps developers write platform-specific code.

Example

import { Platform, Text } from "react-native";

export default function App() {
  return (
    <Text>
      {Platform.OS === "android" ? "Android Device" : "iOS Device"}
    </Text>
  );
}

Explanation

Platform.OS returns "android" or "ios".

38. What are Layout Animations in React Native?

Layout animations allow developers to animate UI changes smoothly.

Example animations:

  • Expanding views
  • Collapsing menus
  • Moving elements

Example

import { LayoutAnimation } from "react-native";

LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);

This creates smooth UI transitions.

39. What are Push Notifications in React Native?

Push notifications are messages sent to users even when the app is not open.

Examples:

  • Chat messages
  • Order updates
  • Promotions

Common libraries used:

  • Firebase Cloud Messaging (FCM)
  • OneSignal
  • Expo Notifications

Push notifications help increase user engagement.

40. What is Code Splitting in React Native?

Code splitting means loading only the required code when needed.

This improves:

  • App performance
  • Loading speed
  • Memory usage

Example approach:

Lazy loading screens

Dynamic imports

Example

const ProfileScreen = React.lazy(() => import("./ProfileScreen"));

This loads the screen only when it is needed.

41. What is the React Native architecture?

React Native architecture allows JavaScript code to communicate with native mobile code.

It mainly consists of three parts:

1. JavaScript Thread

Runs the React Native application logic.

2. Native Thread

Handles native UI components such as buttons, views, and animations.

3. Bridge

The bridge connects JavaScript with native modules.

Flow

JavaScript Code → Bridge → Native Components

This architecture allows developers to build native-like mobile apps using JavaScript.

42. What is Metro Bundler?

Metro Bundler is the default JavaScript bundler used in React Native.

It takes all JavaScript files and combines them into a single bundle for the app.

Main Features

  • Fast bundling
  • Hot reloading
  • Dependency management
  • Code transformation

When you run:

npx react-native start

Metro Bundler starts and prepares the app code.

43. What is the Hermes Engine in React Native?

Hermes is a JavaScript engine optimized for React Native apps.

It improves:

  • App startup speed
  • Memory usage
  • Performance

Hermes is mainly used for Android apps.

Benefits

  • Faster app launch
  • Smaller app size
  • Better performance on low-end devices

44. What is error handling in React Native?

Error handling helps developers detect and manage application errors.

Common methods:

1. Try–Catch

try {
  const data = JSON.parse("invalid json");
} catch (error) {
  console.log("Error:", error);
}

2. Error Boundaries

Used to catch errors in React components.

3. Console Logs

console.error("Something went wrong");

Error handling improves app stability and debugging.

45. What are Memory Leaks in React Native?

A memory leak happens when unused memory is not released properly.

This can cause:

  • App slowdown
  • Crashes
  • High memory usage

Common Causes

  • Unremoved event listeners
  • Unstopped timers
  • API calls after component unmount

Example Fix

useEffect(() => {
  const timer = setInterval(() => {
    console.log("Running");
  }, 1000);

  return () => clearInterval(timer);
}, []);

The cleanup function prevents memory leaks.

46. What is the difference between controlled and uncontrolled components?

Controlled Components

React controls the component state.

Example:

const [text, setText] = useState("");

<TextInput value={text} onChangeText={setText} />

Uncontrolled Components

The component manages its own state.

Example:

<TextInput defaultValue="Hello" />

Controlled components provide better control over data.

47. What is OTA Update in React Native?

OTA (Over-The-Air) updates allow developers to update app code without publishing a new version on the app store.

Tools used:

  • CodePush
  • Expo Updates

Benefits

  • Faster bug fixes
  • Instant updates
  • No app store approval needed

OTA updates are useful for small fixes and UI updates.

48. What is testing in React Native?

Testing ensures that the application works correctly and has fewer bugs.

Types of Testing

  • Unit Testing
  • Integration Testing
  • UI Testing

Popular Testing Tools

  • Jest
  • React Native Testing Library
  • Detox

Example

test("sum function", () => {
  expect(2 + 2).toBe(4);
});

Testing improves code quality and reliability.

49. What is the difference between React Native and Flutter?

FeatureReact NativeFlutter
LanguageJavaScriptDart
Developed byMetaGoogle
UI RenderingNative componentsCustom rendering engine
Learning curveEasier for JS developersSlightly harder

React Native is popular among developers who already know React and JavaScript.

50. Why should developers choose React Native?

React Native is widely used because it offers fast development and cross-platform support.

Main Reasons

1. Single codebase for Android and iOS

2. Faster development

3. Large developer community

4. Reusable components

5. Strong ecosystem

Many companies use React Native such as:

  • Facebook
  • Instagram
  • Airbnb
  • Shopify

This makes React Native a very valuable skill for mobile developers.

Connect With Us
whatsapp