React Interview-Part4

IFFE.
Array and Object destructuring.
Reverse a string without any loop or iterator.
What are the three attributes of the virtualdom that don’t appear in real dom?
Three attributes of the virtual DOM that don’t appear in “real” DOM – key, ref and dang…


This content originally appeared on DEV Community and was authored by Atul Bhatt

  1. IFFE.
  2. Array and Object destructuring.
  3. Reverse a string without any loop or iterator.
  4. What are the three attributes of the virtualdom that don't appear in real dom? Three attributes of the virtual DOM that don’t appear in “real” DOM - key, ref and dangerouslySetInnerHTML.

12 - What is the use of CreatePortal in react?
14- What is html data-* attribute?
15- What are primitive types in JS? Explain the symbol type.
16 - Number.MAX_SAFE_INTEGER !
19 - Do you know about ComponentDidNotMount()?
21 - What is webpack and its role? Can you name an alternative of webpack?

22- What is code splitting and how can we achieve it?
23 - How does import () function works?
The import() function - like form takes the module name as an argument and returns a promise which always resolves to the namespace object of that module.
handleClick = ()=>{
import ('./moduleA')
.then({moduleA})=>{
....do something}).catch(err=>{
//Handle Failure
})
};

24 - What is bundling?
The process of following imported files and merging them into a single file - "a bundle". This bundle can then be loaded on a webpage to load an entire app at once.
Solution for large bundle problem is code-splitting which is supported by bundlers like webpack, rollup, browserify which creates multiple bundles that can be loaded dynamically at runtime. So in other words code-splitting helps in lazyload.

25- What is an import cost?

In React, all DOM properties and attributes (including event handlers) should be camelCased. For example, the HTML attribute tabindex corresponds to the attribute tabIndex in React. The exception is aria-* and data-* attributes, which should be lowercased. For example, you can keep aria-label as aria-label.

dangerouslySetInnerHTML is React’s replacement for using innerHTML in the browser DOM.

Some examples in the documentation use style for convenience, but using the style attribute as the primary means of styling elements is generally not recommended. In most cases, className should be used to reference classes defined in an external CSS stylesheet. style is most often used in React applications to add dynamically-computed styles at render time.

https://jsfiddle.net/marcolanaro/j38zgdum/5/
input type email special behaviour in React.

React will automatically append a “px” suffix to certain numeric inline style properties.
// Result style: '10px'
<div style={{ height: 10 }}>
Hello World!
</div>

What is short-circuiting, nullish, coalesing,and optional chaining in JS?
What do you mean by flattening the closure scope?

What is monkey patching?

Does JS supports multiple inheritance?


This content originally appeared on DEV Community and was authored by Atul Bhatt


Print Share Comment Cite Upload Translate Updates
APA

Atul Bhatt | Sciencx (2022-02-04T07:24:53+00:00) React Interview-Part4. Retrieved from https://www.scien.cx/2022/02/04/react-interview-part4/

MLA
" » React Interview-Part4." Atul Bhatt | Sciencx - Friday February 4, 2022, https://www.scien.cx/2022/02/04/react-interview-part4/
HARVARD
Atul Bhatt | Sciencx Friday February 4, 2022 » React Interview-Part4., viewed ,<https://www.scien.cx/2022/02/04/react-interview-part4/>
VANCOUVER
Atul Bhatt | Sciencx - » React Interview-Part4. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/02/04/react-interview-part4/
CHICAGO
" » React Interview-Part4." Atul Bhatt | Sciencx - Accessed . https://www.scien.cx/2022/02/04/react-interview-part4/
IEEE
" » React Interview-Part4." Atul Bhatt | Sciencx [Online]. Available: https://www.scien.cx/2022/02/04/react-interview-part4/. [Accessed: ]
rf:citation
» React Interview-Part4 | Atul Bhatt | Sciencx | https://www.scien.cx/2022/02/04/react-interview-part4/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.