Adarsh Guptaโšก
Adarsh Guptaโšก

@Adarsh____gupta

11 Tweets 1 reads Jan 24, 2023
Recently, I attended an interview for a React JS developer role.
Here are 9 questions that you need to know. ๐Ÿš€:
1. What are the features of React
- JSX
- Components
- Virtual DOM
- Unidirectional Data flow
What is the difference between Element and Component?
An element is a simple object that describes a DOM node and its attributes. It is an immutable description object and you can not apply any
A component is a function or class that accepts an input and returns a React element
3. What are stateful and stateless components in React?
Stateless components are simple functional components without having a local state, whereas stateful components can contain the state object and event-handling functions as well as user actions.
4. Can JSX code directly run on a browser?
Because there is no inherent implementation for the browser engines to read and interpret JSX, browsers cannot read it.
The JSX is designed to be utilized by various transpilers to convert this JSX into legitimate JavaScript code;
5. Why should we not update the state directly?
It appears that we are not utilizing the best features of React if you attempt to update the state directly, as it won't cause the component to re-render.
Use the function setState(). It plans a state object update for a component
6. What is ReactDOM?
ReactDOM is a package that offers DOM-specific methods that can be used at the top level of a web app to enable an effective way of managing DOM elements of the web page.
7. What arethรฉ e pointer events supported in React
Pointer events provide a uniform way of handling all input events. The following event types are now available in the React DOM
8. What do portals in React mean?
To render children into a DOM node that is not part of the parent component's DOM hierarchy, we use the portal technique.
9. What are the limitations of React
โ€ข React is not a complete framework, it is a view library.
โ€ข React is only the view part of Model View Control architecture
โ€ข Too many small components can result in overengineering or boilerplate.
โ€ข React is not an all-in-one solution
Thanks for checking this out.
1. Retweet the first tweet.
2. Like this if you want more threads like this
3. Follow @Adarsh____gupta for more.

Loading suggestions...