Lesson Learnt: Isolate Components Behavior in ReactJS

Reading Time: 4 minutes

hangmanA few weeks ago I complained that calling asynchronous operations inside Reacts lifecycle method componentWillMount like AJAX may have collateral effects. In my case, the application hangs and stuck inside an infinite rendering loop. I discovered that my first attempt to solve the problem was by no way the solution, although I thought it was. The real cause was an unfortunate composition of components. The scenario was the following:

Continue reading

Decorator Components with ReactJS

Reading Time: 7 minutes
Decorator Pattern in OO

Decorator Pattern in OO

Today I'd like to talk about a composition pattern, which can be best denominated as Decorator. Like in object oriented programming the decorator wraps a component and extends its functionality, usually without changing the basic behaviour. With the composition capabilities of ReactJS it is possible to adopt this concept and allows to create components that extends other components, for example by visual effects, or pure functional behaviour like logging activities. In this article I'll present a simple use case demonstrating the pattern.

Continue reading

The Dojo is open for public

Reading Time: 1 minutes

 

Enter the DojoToday, I added a Live Demo section, called Dojo, where I published and will publish some of my training sessions, called Kata. Everyone who is interested can enter the Dojo, and view the Katas. The objective is to spread my knowledge, but also gain constructive feedback - all within the spirit of Software Craftsmanship.