News for hackers. Stuff that matters.
Re:Two custom React hooks by steve_adams_86 on Friday December 17, 2021 @01:55PM (#29596641)
I'm not sure I understand. Which two hooks would be called in this case? In the original example I'm seeing where there's anything atomic involved across multiple hooks.

Are you referring to the usePromise and useAsyncExtendedState? If so, it's okay to use those hooks independently. They work fine without each other, but they also work well together.

Re:Two custom React hooks by jakelazaroff on Saturday December 18, 2021 @01:10AM (#29602158)
I’m saying that if you have multiple pieces of state that must be updated atomically, it makes sense to store them in an object in one useState hook because it signals to other developers that they should be updated together. The fact that React allows you to batch the renders if you store the state in two separate hooks is unimportant.