DEV Community

Discussion on: Synchronous State With React Hooks

Collapse
 
bytebodger profile image
Adam Nathaniel Davis • Edited

One of my previous approaches was making the validations async. That... worked. But I don't consider it to be ideal. Not that I have any problem with the concept of async/await, but it's kinda like a virus that spreads beyond its originally-intended borders, cuz await must be inside async. And once you make a function async, it returns a promise, that (depending upon your project and your inspections) either should or must be handled. Which too often leads to making the caller async, which in turn leads to the caller's caller being made async...

Before you know it, every dang function is async - which makes everything kinda messy for no good reason.

Collapse
 
sirseanofloxley profile image
Sean Allin Newell

Agreed.