React Native اسئلة واجوبة المقابلات
سؤال 11. How do you handle navigation in React Native?
React Navigation is a popular library for handling navigation in React Native. It provides a navigation structure that allows developers to navigate between screens in a React Native app.
سؤال 12. What is the purpose of 'AsyncStorage' in React Native?
'AsyncStorage' is a simple, asynchronous, key-value storage system in React Native. It is used for storing small amounts of data persistently across app restarts.
Example:
import AsyncStorage from '@react-native-async-storage/async-storage';
AsyncStorage.setItem('key', 'value');
سؤال 13. What are Hooks in React Native?
Hooks are functions that allow developers to use state and other React features in functional components. Common hooks include useState and useEffect.
Example:
const [count, setCount] = useState(0);
useEffect(() => {
console.log('Component mounted!');
}, []);
سؤال 14. How can you optimize performance in a React Native app?
Performance optimization in React Native can be achieved by using PureComponent, memoization, optimizing renders, and using tools like React DevTools.
سؤال 15. What is the purpose of 'StyleSheet' in React Native?
'StyleSheet' is used to define styles in a React Native app. It provides an abstraction that enables better performance by allowing the framework to optimize the styling.
Example:
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});
الاكثر فائدة حسب تقييم المستخدمين: