I am new to Reactjs and trying to do some simple stuff. In the below code snippet I have declared two state variable counter and setCounter to 9 but when I am rendering both of them in the UI {setCounter} is not getting rendered whereas I am able to see 9 in the UI which is the {counter}
import * as React from 'react';
const {useState} = React;
export default function App()
{
const [counter, setCounter] = useState(9); // Declaring State variables
return (
<>
<p>{counter}</p>
<p>{setCounter}</p>
</>
)
}
Please suggest where I am doing wrong.