As I mentioned previously, GeeryDev is back and it has been rewritten in React and Redux. Now, I must admit, that the list of things I did wrong continues to grow, but it was a pleasant experience. This post is a summary of the little things that I noticed along the way. For those who may not be aware. I was very new to React when taking up this project, but had used Redux for a little while. So there was a learning curve, but not too steep.
Also, I decided to start putting the source into Github in case anybody is concerned. Feel free to checkout the code here
Nearly all the resources you find online today for React are going to make mention of the idea of components vs containers. I don’t think a lot of the examples and instructions are very good, or at least I think they could be more pragmatic. Or maybe I am just slow. Read more about it here, here or here. Components are dumb. They should not talk to your redux store or know anything about fetching data, but instead have all their props passed to them. I think this sets us up nicely to have our components become reusable
Containers are the parts of your app that deal with your data. These can be considered the “smart” parts of your application, or the ones that scaffold the layout by providing the data and passing it to components. These are the components that would be connected to a redux store.
I have yet to dive into any of the more advanced testing frameworks like Facebook’s Jest, or AirBnb’s Enzyme. I will eventually. But, at this point, it has not been necessary. Working with mocha and jsdom has been a very enjoyable experience, and has handled most of use cases. You can find the geerydev tests here