231. What is the main purpose of code splitting in a React application?
Answer:To reduce the size of the initial bundle
232. Which built-in method in React allows you to perform code splitting?
233. What is the key advantage of lazy loading components in a React application?
Answer:Faster initial page load
234. In which lifecycle method can you use code splitting and lazy loading in a React component?
235. How does React determine when to load a lazily loaded component?
Answer:When the component is imported
236. What is the purpose of the Suspense component in relation to lazy loading in React?
Answer:It's used to display a loading indicator
237. In React, what is the primary function of the React.lazy() function?
Answer:To wrap a component for lazy loading
238. Which error boundary component can be used to handle errors during lazy loading in React?
239. What happens if an error occurs while loading a lazily loaded component in React?
Answer:The error is caught and can be handled
240. What is a common use case for code splitting and lazy loading in a React application?
Answer:Loading large libraries or third-party code