- How React Native is different from ReactJS?
- What are the Basic Components used in a React Native app?
Most React Native apps will have at least one of the following fundamental components, which will be encountered by every React Native developer.
- View: The most basic component for building a React Native UI is the view. The VIew has flexbox support, style, some touch support, and accessibility controls.
- Text: Text is a react component for displaying text with nesting, styling, and touch support.
- Image: A react component for displaying a variety of photographs, including those from the camera roll.
- Scroll View: A scrolling container that can accommodate many components and views is known as a ScrollView.
- TextInput: The most basic component for using a keyboard to enter text into the program.
- StyleSheet: StyleSheet is an abstraction that allows you to specify styles for various containers, comparable to CSS StyleSheets.
- What is JSX?
- What’s the difference between ScrollView and FlatList?
A list of components is displayed in a React Native project using the ScrollView and FlatList components. ScrollView, on the other hand, has a drawback in terms of performance. As soon as the component loads, ScrollView will load all of the items. As a result, all data is kept in RAM, and the greater the amount of data slower the speed.
FlatList, on the other hand, shows items slowly; by default, it will display 10 items on the screen, with further items appearing as the user scrolls the view. For a small number of things, you can use ScrollView, and for a large number of items, you can use FlatList.
- What is Redux and when should you use it?
- Your app’s status is often changed.
- You have a lot of app states, and it’s used in a lot of locations throughout the app.
- The reasoning for updating the state of your program is complicated.
- You’d like to see how the state has changed throughout time.
- Your app’s codebase is medium or huge, and it will be worked on by several people.
- What happens when you call SetState?
When you call SetState in React, the object you pass in is merged into the component’s current state. This sets in motion a process known as reconciliation. The goal of reconciliation is to update the user interface as quickly as feasible. React accomplishes this by creating a React element tree and comparing it to the previous element tree. This shows React the exact changes that occurred, allowing React to make modifications where they are needed.
- Describe how the Virtual DOM works?
The Virtual DOM is a replica of the real DOM in React Native. It’s a node tree that shows elements’ attributions, contents, and properties. The UI will be re-rendered whenever our underlying data changes. The discrepancies between other DOM representations and Virtual DOM representations will be counted after that, and the real DOM will be updated.
- Name a few companies or applications that are built using React Native?
Many well-known organizations are using React Native to build their mobile apps. Facebook, Airbnb, Instagram, Pinterest, Uber, and Tesla are just a handful of the big names whose main consumer-facing mobile app is built with React Native. This demonstrates their confidence in the React Native framework. Airbnb was one of the first companies to use React native. They were eager to share their knowledge of React Native technology. They also released several React native libraries that were created on top of the React Native framework. Lottie, one of their most well-known packages, allows you to create intricate animations in React native. React native is being used by a lot of entrepreneurs to construct their mobile apps. They may swiftly debut their concept on both Android and iOS platforms at the same time.
- What are the benefits of using React Native for building mobile applications?
There are various benefits of using React Native for building a mobile application. The benefits include:
- React Native allows for the majority of the code to be shared between the Android and iOS apps.
- Maintenance work is much reduced with a single code base.
- React Native application can be used and maintained on a variety of platforms, making it an extremely versatile framework.
- What is the difference between a functional component and a class-based component?
There are some basic differences between a functional component and a class-based component
- There can’t be a functional component that isn’t stated. It just renders components based on the properties supplied. A local state can be used in a class-based component, which might be useful when developing a larger component.
- The props parameter is used to access the functional component directly. Props are accessible through this in a class-based component.
- A component that is based on classes has a more complicated structure. It’s an instance of a React-derived class. A component is a type of class. A render member method must be implemented in the class, which yields a React component to be rendered.
- Lifecycle methods are also available to class-based components, but not to functional components.
- In comparison to class-based react components, functional components are considerably low weighted.