this post was submitted on 29 Jun 2023
7 points (100.0% liked)

JavaScript

1700 readers
1 users here now

founded 1 year ago
MODERATORS
 

Am I the only one that feels kinda lost trying to debug things in Redux?

Maybe I got spoiled with Nuxt, maybe I need different browser tools, maybe I need to take a redux/reselect course to remind myself wtf is going on over here...

but I feel like even simple things like seeing a components props or the app state is difficult to do in browser inspector, even with the usual react browser extension.

I don't know what I'm hoping for here ... maybe a youtube video recommendation or a browser extension or a tiny violin. Either way this seemed like the best community on Lemmy to ask.

top 5 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 1 year ago (1 children)

Are you using the extension for redux debugging as well? I know you mentioned the usual react extension but just mentioning it in case.

https://github.com/reduxjs/redux-devtools

[–] [email protected] 2 points 1 year ago (1 children)

This didn't work 'out of the box' for me so I bounced off it. Sounds like its worth another look. I'll dig into it today. Thank you!

[–] [email protected] 2 points 1 year ago (1 children)

Hopefully it helps you 🥰

If the code base you are working with dumps a ton of shit into the redux state it might need to be sanitized. I implemented this at my last role and it actually redeemed the dev tools tab to being useable rather then just crashing

I would also mention Redux has kinda fallen out of fashion for some other choices now. I personally use Zustand/Jotai but the move to redux tool kit can be an easier step if it’s an option

[–] [email protected] 2 points 1 year ago

its enterprise company code so it's definitely older as far as tooling. No typescript yet, etc.

If I dont have any luck with the redux tools I'll look into sanitizing the redux state. Thanks for the tip!

[–] yads 1 points 1 year ago

I've honestly never had an issue, but maybe it's just Stockholm syndrome lol? The basic react extension definitely shows you component props and shows the component tree. The redux extension shows the state and all the events. It allows you to go backwards and forwards in time and send your own events. What exactly have you had issues with?