Check out example codes for "components react to hooks". It will help you in understanding the concepts better.

Code Example 1

const App = () => {
const [students , setStudents] = useState([]);
  
  return (
// put in the jsx code here
  )
}

Code Example 2

import React, { useState } from 'react';
function Example() {
  // Declare a new state variable, which we'll call "count"  const [count, setCount] = useState(0);
  return (
    <div>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>
        Click me
      </button>
    </div>
  );
}

Learn ReactJs, React Native from akashmittal.com