Question | Answer |
---|---|
What is the difference between controlled and uncontrolled components in React Native? | Controlled components: React manages the state. Uncontrolled components: DOM manages the state. |
What are React Native bridges and how do they work? | React Native uses a bridge to communicate between JavaScript and native code, allowing native modules to be accessed. |
What is JSX in React Native? | JSX allows writing HTML-like syntax within JavaScript. It gets converted to native components during the build process. |
Explain the role of the `useEffect` hook in React Native. | `useEffect` is used for side effects, such as fetching data or subscribing to external services after the component mounts. |
What are some performance optimizations available in React Native? | Using FlatList, memoization, lazy loading, and optimizing bundle size are common performance optimizations. |
How does React Native handle navigation between screens? | React Native uses libraries like React Navigation or React Native Navigation to manage navigation between different screens. |
What is the difference between `componentDidMount` and `useEffect`? | `componentDidMount` is for class components, whereas `useEffect` is used in functional components to handle side effects. |
How do you optimize an app built with React Native for performance? | Use native code for performance-critical sections, implement memoization, avoid unnecessary re-renders, and optimize images. |
What are Native Modules in React Native? | Native Modules are used to write native code (Swift, Objective-C, Java, or Kotlin) and access it from JavaScript. |
What is the purpose of `AsyncStorage` in React Native? | AsyncStorage is used to store simple key-value data persistently in the device’s local storage. |
What is React Native bridge? | The React Native bridge allows communication between JavaScript and native modules. It helps to call native functions from JavaScript and vice versa. |
What are the different ways to style components in React Native? | React Native supports inline styling, external stylesheets, and using libraries like `styled-components` for styling components. |
What is the difference between `TouchableOpacity` and `TouchableHighlight`? | `TouchableOpacity` provides a fading effect when the user presses it, while `TouchableHighlight` provides a visual feedback on press with a background color change. |
What are Hooks in React Native? | Hooks are functions that let you use state and other React features in functional components, such as `useState`, `useEffect`, and `useContext`. |
What is Redux, and how is it used in React Native? | Redux is a state management library for React and React Native. It helps to manage the app’s global state in a centralized store, which is accessible by all components. |
Explain the `FlatList` component in React Native. | `FlatList` is an optimized component for rendering long lists of data, supporting features like lazy loading, item separators, and handling large datasets efficiently. |
How do you debug React Native apps? | React Native apps can be debugged using tools like Chrome DevTools, React Native Debugger, and Flipper for inspecting and debugging app state, network requests, and UI. |
What is the use of `react-native-vector-icons`? | `react-native-vector-icons` provides customizable icons that can be used in React Native apps. These icons can be imported and used in the components for UI enhancements. |
Explain how to handle device permissions in React Native. | React Native provides libraries like `react-native-permissions` for requesting and managing permissions (like camera, location, etc.) on iOS and Android. |
How do you manage different environments in React Native? | You can manage different environments (e.g., development, staging, production) in React Native by using libraries like `react-native-config` to load environment variables. |
Popular Search Keywords
- React Native interview questions for senior developer with answers
- React Native interview questions GitHub
- React Native interview questions for senior developer pdf
- React Native interview questions for 7 years experience
- React Native interview questions advanced
- React Native interview questions for 5 years experience
- React Native interview questions for 2 years experience