React Native Interview Questions and Answers
Ques 1. What is React Native?
React Native is a JavaScript framework for building mobile applications using React. It allows developers to use React to build mobile apps for iOS and Android platforms.
Example:
import React from 'react';
import { Text, View } from 'react-native';
const App = () => {
return (
Hello, React Native!
);
};
export default App;
Ques 2. Explain the difference between React and React Native.
React is a JavaScript library for building user interfaces, primarily for web applications, while React Native is a framework for building mobile applications using React for iOS and Android platforms.
Ques 3. How does React Native achieve cross-platform functionality?
React Native achieves cross-platform functionality by allowing developers to write components in JavaScript and then rendering them using native components for each platform.
Ques 4. What is JSX in React Native?
JSX (JavaScript XML) is a syntax extension for JavaScript used with React Native. It allows developers to write HTML-like code in their JavaScript files.
Example:
Hello, JSX!
Ques 5. Explain the purpose of 'state' in React Native.
State in React Native is a way to manage the internal state of a component. It represents the data that can change over time and influences the rendering of the component.
Example:
const [count, setCount] = useState(0);
Most helpful rated by users: