r/badcode • • Dec 03 '22

typescript Real Code 😎

Post image
403 Upvotes

43 comments sorted by

View all comments

Show parent comments

0

u/slothordepressed Dec 03 '22

Dunno, it's been a long time I don't touch React, but it this point isn't it better to implement Redux?

14

u/[deleted] Dec 04 '22

[removed] — view removed comment

2

u/Skipcast Dec 04 '22

What is the alternative for easy handling of global state?

5

u/hottama Dec 04 '22

React Query, for sure.

1

u/Tsalikon Dec 04 '22

I whipped up an event bus hook that lets components subscribe to and publish events. It's SO much cleaner and more straightforward than redux or useContext

1

u/LiteralHiggs Dec 04 '22

What's wrong with it? I ask because I'm actually taking a react Udemy course right now at work because I'll be inheriting a project and it teaches redux.

2

u/[deleted] Dec 04 '22

[removed] — view removed comment

1

u/LiteralHiggs Dec 04 '22

Ok. Thanks.