Is SetState Asynchronous???? #reactjs #react #javascript

preview_player
Показать описание
Changing state in React is commonly thought of as asynchronous because when setState is called, the new state isn't available right away.

📚 My Courses 📚

💻 My Software 💻

👩‍💻 Download Code 👨‍💻
Рекомендации по теме
Комментарии
Автор

Nice explanation. I have a question. In class components we have a setstate which updates the state variable and we can also pass the callback function as a second argument in which we can log the updated state, in the same scope where setstate is been performed. Is there a way to do this using functional usestate hook?

manalavi
visit shbcf.ru