My Experience with React and Redux

Michael Martinez
2 min readAug 19, 2021

The process of learning React and redux was a bit of an up and down for me. While react was initially pleasingly simple and easy enough for me to pick up, wrapping my head around redux was a whole different deal. To begin with, I wondered at first why we needed redux when passing down props to children seemed to do the job just fine. It wasn’t until I learned how convenient it was having access to the store via dispatch and props and then later on hooks, that I really began to see the usefulness of redux.

One of the biggest hurdles of my project was initializing and setting up Devise for authentification. I’d only had experience using bcrypt in the past in my rails and JS projects. The documentation proved to be a bit confusing but I eventually figured it out. For example, I looked to creating custom methods for the user registration’s create methods so that I can override the default behavior(or sometimes just impose on it using ‘super’) so that I could correctly set up my associations on the backend of my project. I then later on had an issue with my authenticated pages reloading, which I narrowed down to my secret key not being read correctly. This problem turned out to have a simple solution: I had forgotten the dotenv gem and quickly fixed my quite foolish mistake.

React hooks were one concept I had avoided until I figured I’d waited long enough. I realized hooks were actually not as complicated as they seemed, for the most part. In fact, they made it quite easy to access parts of the store as with redux hooks or just give functional components the same functionality as class components with the useState hooks and other react lifecycle methods. I experimented quite a bit with hooks and came to like them. I felt they gave much more flexibility than classes did. There was the issue of not being able to use them outside of the main exported functional component but I was able to work around this issue for the most part.

--

--