In this code i expect when i clicked asycn change button to have output: num1: 6 num1: 7
as each state update in then() block so React does not batch the updates
but i got 2 lines: num1: 6
import React, { useState } from "react";
import { Button } from "react-bootstrap";
const Test = (props) => {
const [num1, setNum1] = useState(5);
const [num2, setNum2] = useState(6);
const syncClickHandler = () => {
 setNum1(num1 + 1);
 setNum1(num1 + 1);
};
console.log("num1 " + num1);
const asyncClickHandler = () => {
 Promise.resolve()
  .then(() => {
    setNum1(num1 + 1);
  })
  .then(() => {
    setNum1(num1 + 1);
  });
};
return (
 <div>
  num1: {num1} , num2: {num2} <br />
  <Button onClick={syncClickHandler}>sync change</Button>
  <Button onClick={asyncClickHandler}>async change</Button>
 </div>
 );
};
export default Test;
why i got this output
 
    
