Загрузка видео...

Не удалось загрузить видео

На главную

A cure for React useState hell? You may not realize how easily you can replace useState with useReducer and simplify your state management You can read more in my latest blog post:

609,303 просмотров • 3 лет назад •via X (Twitter)

Комментарии: 10

Фото профиля Steve (Builder.io)
Steve (Builder.io)3 лет назад

Huge kudos to @DavidKPiano for first pointing this out in his epic thread:

Фото профиля Steve (Builder.io)
Steve (Builder.io)3 лет назад

If you are interested in this topic and want to read further, I go into more detail in my blog post:

Фото профиля Steve (Builder.io)
Steve (Builder.io)3 лет назад

And follow @DavidKPiano - he is the creator of XState and @statelyai and posts tons of great content and tips on state management patterns

Фото профиля Steve (Builder.io)
Steve (Builder.io)3 лет назад

Also if you are a fan of YouTube I’ve started posting videos there as well

Фото профиля Marton Sari
Marton Sari3 лет назад

To me it makes no sense to do validation like that. The pattern you reach with this is silent errors all around. If you want user input validation, you do it with an explicit mechanism with feedback (client/server/isomorph). If you want dev consistency, you do it on type level.

Фото профиля Steve (Builder.io)
Steve (Builder.io)3 лет назад

Generally speaking, imo you should have both

Фото профиля Erik Rasmussen 👨‍💻🇺🇸🇪🇸
Erik Rasmussen 👨‍💻🇺🇸🇪🇸3 лет назад

@DavidKPiano This is super cool. I feel like you made a typo in the video (and blog post). Surely this should be `Math.min(next, 10)`, right?

Фото профиля Steve (Builder.io)
Steve (Builder.io)3 лет назад

@DavidKPiano Doh, yes, thank you!

Фото профиля Vibbs Dod
Vibbs Dod3 лет назад

Have you checked out Learnt about it from new react beta docs, might help with pain points that you are talking about.

Фото профиля Steve (Builder.io)
Steve (Builder.io)3 лет назад

Wrote about this in the blog post, Immer is amazing

Похожие видео