React... engineering!!
Some spare thoughts about my experience with React the last months...
So, the last few years I have worked a lot with back-end technologies and database designs. Usually, when you design a new system it is required a lot of "whiteboard sessions" in order to make sure that you will create a robust and maintainable system. Thats on back-end services..
On front-end, my past experience with Angular showed me that with some basic planning and good coding principles it is straight forward how you can develop a SPA. But its not the same with React!! Or it wasn't for me when I first started using it. You have to think in "React" way and follow the principles of Flux (or Redux, etc..) design pattern. You cannot just update the state of a variable and expect that this will populated through the SPA (as Angular factories for example). In React and Flux, you have to call an action that is registered on a store that will trigger re-rendering of all the components that this change affects. And that is just one thing.
To begin with, I recommend you to grab a yo generator with a simple/well structured react project and start playing with it. After a while you will understand why you need to use... a whiteboard to design the data-flow. There are so many questions "Where I will put my controller-view component?", "How many props I need to pass on child components?", "How I should only trigger re-rendering when the state of variable updated but not changed?". Thats proper engineering to me and I'm excited to design these type of applications.
Some React tools and libraries that I really enjoy working with:
- First of all Material UI, all the components are well documented and they look great.
- React-hot loader and React chrome extensions save a lot of developing time.
- And an awesome tutorial that helped me a lot, link.
Happy developing!!