r/reactjs•
kuse

To learn redux I built an NBA Stats Compare App. Critique welcome.

Code Review Request

Link to project - https://nbav-2-rkw3y.ondigitalocean.app/#/

Link to Github Code - https://github.com/Druashley/nbav2

Hello,

I am self taught dev and this is an app I built out to learn redux. The app uses chartjs and the balldontlie api to compare NBA players and their seasonal stat averages. I still used some local state management because redux is a bit overkill for the size of this project and I was simply trying to scratch the surface of redux. And it seems like both local state and redux state is used in most large projects? (correct me if I am wrong.)

I would appreciate any critique of the project and the redux implementation.

Cheers

Posted Dec 6, 2021, 7:10 PM UTC

1313
romeeres•

If I open official redux site https://redux.js.org/ and press Get Started it says to install redux toolkit, with pretty big letters.
I guess the problem with RTK is that most people who starts are learning by youtube without even opening official docs, is this true?

9
kuseOP•

I referenced some pages during implementation, but I did not begin my learning from the offical docs. I was not aware nor did I even notice RTK existed. Thank you for this.

3
acemarke•

Heh. In all honesty, this is one of the things that I am most sad about as a Redux maintainer. No matter how much effort we put into the docs, many people will never even look at them :(

and since there are thousands of horribly outdated tutorials that will never be updated, that means that a lot of folks like yourself will not see anything about RTK as they're learning Redux, and only ever learn how to use legacy Redux patterns that are very outdated and much harder to use than "modern Redux" with RTK.

7
kuseOP•

I am happy that I got to learn it the incorrect way and can now look into the RTK. Great job working on it!

1
[deleted]•

Two of those reducers aren’t needed at all and can be managed with local state. Idk if it’s quite anti pattern but storing input values in redux isn’t good. Knowing when to use redux is the most important thing about redux tbh

3
kuseOP•

That makes sense. This project was not necessarily about whether or not redux should be used, but a test to see how I could implement it. I agree 100% that this could all easily be done with local state. I appreciate the information about the input values and thanks for looking at the code!

3
RogueToad•

I'm just getting started myself, so I don't have much criticism to offer - but great work! Inspires me to do some more random projects.

Also how'd tailwind work out? It looks a lot cleaner than what I normally do with styled-components, I end up with so many components just for styling.

2
kuseOP•

Tailwind has been great. I have used it in most of my projects.

https://www.tailwind-kit.com/

https://blocks.wickedtemplates.com/

These two links have been great resources for me to learn with and are very popular on reddit as far as I know. I like them because I can see the code and use that for inspiration.

https://daisyui.com/

Daisyui is a package you have to add in addition to tailwind and I found it to be great as well.

1
RogueToad•

That looks awesome, thanks. Yeah I definitely like the idea of the components library using the same styling toolkit that I'm using myself. I'll some of those a try in my next project.

1
[deleted]•

[removed]

1
GrasseBort1•

Some minor CSS problem in mobile, YouTube embebbed video IS bigger than the background imagen and creates two whites columns to right and left

1
kuseOP•

Thank you for this. The youtube video was the last thing I put together before making this post. I did not check and thought it would scale properly. Fixed now with the changes currently being deployed. <3

2
maryP0ppins•

Dan Abramov said in a recent youtube [video](https://www.youtube.com/watch?v=XEt09iK8IXs&t=2727s&ab_channel=BenAwad) to use redux when you dont know where to put something. so it needs to be a pretty big app to get to that point. context API should take care of most needs.

-5
kuseOP•

Yep - we all saw that video. Redux is still used in countless projects and being able to understand it as a newbie can be a bit difficult. My goal with the project as mentioned above was about implementing the technology to an extent, not justifying its usage.

1