React Native Pertanyaan dan Jawaban Wawancara
Ques 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.
Ques 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');
Ques 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!');
}, []);
Ques 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.
Ques 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',
},
});
Most helpful rated by users: