Let me tell you first that I am still young in react but according to my understanding it is slightly complicated to answer this question. sometimes when state does not change the component does not re render. but if you are using useEffect hook and changing the state even if the state is same, it will cause render. Here is the code example.
function App() {
const [state, setstate]=useState(1);
function myfun(){
setstate(3);
}
useEffect(()=>{
setstate(2)
console.log("i am useeffect");
})
return (
<div>
{state}
{console.log("i am app.js")}
<button onClick={myfun}>clickme</button>
</div>
);
}
export default App;
in the useEffect I am setting state. After the first render the useEffect will run it will change the state the render will again happen and useEffect will again run although this time the state is same it will render once again. You can see console but on the other side if you click on button once and change the state next time when you click the button the render will not happen.