Hi I want to update a certain state right after setting another. This has to happen in a synchronous order to prevent undesired effects.
useEffect(() => {
if (customDate.from && customDate.to) {
applyFilter(customDate);
setCustomDate([]);
}
}, [customDate, applyFilter]);
Right now it's working, but i've read that state updates are asynchronous. How can i make sure it happens in synchronous orders.