• +91 9723535972
  • info@interviewmaterial.com

ReactJS Interview Questions and Answers

Related Subjects

Question - What are fragments?

Answer -

In was introduced in React 16.2 version. In React, Fragments are used for components to return multiple elements. It allows you to group a list of multiple children without adding an extra node to the DOM.

Example

render() {  
  return (  
      
        
        
        
      
  )  
}  
There is also a shorthand syntax exists for declaring Fragments, but it's not supported in many tools:

render() {  
  return (  
    <>  
        
        
        
      
  )  
}  

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners