What is ListView?

ListView is a core component of React Native, which contains a list of items and displays in vertical scrollable lists. In the context of React Native, ListView is an older component that was used for efficiently rendering lists of data. However, it has been deprecated in favor of newer alternatives like FlatList and SectionList. ListView … Read more

How React Native handle different screen sizes?

React Native provides many ways to handle screen sizes. Some of them are given below: 1. Flexbox: It is used to provide a consistent layout on different screen sizes. It has three main properties: flexDirection justifyContent alignItems 2. Pixel Ratio: It is used to get access to the device pixel density by using the PixelRatio … Read more

When would you prefer a class component over functional components?

We prefer class component when the component has a state and lifecycle; otherwise, the functional component should be used. In React Native, functional components and class components are two primary ways of creating components. However, with the introduction of React hooks, functional components have become more powerful and versatile, often making them the preferred choice. … Read more

What is meant by InteractionManager, and why it is Important?

The InteractionManager is a native module in React Native, which is responsible for differing the execution of a function until an interaction has finished. To handle this deferral, we need to call InteractionManager.runAfterInteractions(() => {…}). The InteractionManager is important because React Native has two threads. One is JavaScript UI thread, which handles drawing updates to … Read more

What is meant by HOC in React Native?

HOC Stands for Higher-Order Component. It is a technique, which allows you to reuse the component logic. It is a function that takes a component and gives back a new component. Syntax const NewComponent = higherOrderComponent(WrappedComponent); In React Native, as in React, HOC stands for Higher Order Component. A Higher Order Component is a pattern … Read more