const [page,setPage] = useState()
console.log(page) // gives "Page1" upon state update
const onValueChange = (event) => {
console.log(page); //gives undefined upon state update
};
<Input
onChange={(e) => onValueChange(e)}
/>
<SelectDropdown
onChange={() => setPage("Page1")}
value={page}
/>
Above code is a brief example on how I cant access the state "page" inside the function from an eventHandler, how is it possible to access the state inside onValueChange().