REACT INTERVIEW QUESTIONS:
There are some most Important React Interview Questions You must go through them before your Interview
What Is React?
React is a FrontEnd Javascript library that is Used to build UI or user-interface build or developed by Facebook and the current version of React is 18.0.2
What is JSX?
JSX is a Javascript Extention or Syntax in which we can write HTML code with Javascript by using Babel
What are the Components of React?
Components are Independent and small bits of code and also reusable components.
Difference b/w Class Component & Functional Component?
Class Component:
Class Component in which we extend a React with Component and there is a Render Method which returns a react element and also class component have some lifeCycle Methods.
1) ComponentDidMount
2) ComponentDidUpdate
3) ComponentWillUnmount
Functional Component:
Functional Components are those in which we accept props as an argument and there is a return method that returns our react element.
What are the props?
props are simply a concept in which we can pass data from one component to another.
What is State in React?
The state is simply that holds some data.
What is Virtual Dom?
virtual Dom is simply a corresponding copy of the real Dom It has some more benefits like an updating speed fast it can not create new Dom if any changes occur.
What is UseEffect?
UseEffect Hook is simply a Hook of Functional Component in which we can update a Component Directly and also when we want API Calling also UseEffect Used and there is a Dependency array in UseEffect in which we pass a State whenever the state updates UseEffect Recalls.
What is Conditional Rendering?
This is the concept in which by Applying some specific Condition we can show and hide elements.
What is React Router Dom?
It's a library for the purpose of Routing and moving in different pages.
What is Redux?
Redux is Used For Global State Management in Which we Can pass States from anywhere and Access them by Using the useSelector and UseDispatcher.
What is Context API?
Context API is Also Used for global State Management and we can pass state from anywhere in components.
What is Lazy Loading in React?
Lazy Loading is a Technique in React for loading components or modules when they are needed.
What is Mount or Unmount in React?
Mount and Unmount Concepts in React are
Mount is Adding nodes to the Dom and Updating the Dom on the Other Hand Unmount is Removing the nodes to the Dom and Updating the Dom.
What is UseMemo?
UseMemo will only recompute the memoized value when one of the inputs has changed like we simply pass an array of inputs in a function and when inputs have changed the function recompute memoize the value.
What is UseCallBack()?
UseCallBack is a hook in a functional component that only recomputes the memoized callback function. Memoize means those functions that return some result etc.
What is UseReducer?
UseReducer is a Hook in Functional Components and one of the built-in hooks in React that provides a way to manage complex state logic in functional components. It is typically used when state transitions involve multiple sub-values or when the next state depends on the previous one. It is similar in concept to the setState
method in class components but offers more control and flexibility.
The reducer function defines how the state should change based on different actions. When an action is dispatched, React calls the reducer with the current state and the action, and the reducer returns the new state.
What Are the Advantages of Using React JS?
Component-Based-Architechture:
We Can simply divide the code into small code bundles like a small bit of code then by using export import we can use that module in any desired Component.
Reusability:
We simply divide codes and we can use that code as a component anywhere throughout in application and those components are highly reusable.
Virtual-Dom:
It Uses Virtual Dom its a corresponding copy of the real Dom and if any changes occur it can not create a new Dom it updates only those changes in the actual Dom which is Occur.
Seo-Friendly:
React can be used on the server side (server-side rendering or SSR), making it SEO-friendly. Search engines can easily crawl and index pages with server-rendered content.
useState
, useEffect
, or other custom hooks) to manage state and side effects. These hooks can be used in functional components, just like built-in React hooks.
0 Comments