• +91 9723535972
  • info@interviewmaterial.com

ReactJS Interview Questions and Answers

Related Subjects

Question - What are hooks in React?

Answer -

Hooks are the new feature introduced in React 16.8 version that facilitates us to use state and other React features without writing a class.

See the following example of useState hook:

import { useState } from 'react';  
function Example() {  
  // Declare a new state variable, which we'll call "count"  
  const [count, setCount] = useState(0);  
  return (  
   
  
     

You clicked {count} times

  
     
        Click on this button  
        
   
  
  );  
}  

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners