Conditional Component Composition

In this post, I would like to share two related things that I have developed in the course of a recent client project: ConditionalComponent and composeIf. Conditional Components Sometimes there is the need to render one component or another, based on some condition or context. This is usually done by either an early return or […]

How to Test Container Components in React

Assuming you would want to unit-test container components in React (i.e., connected components in a Redux-based project), or any component that is wrapped in a higher-order component (HOC) etc. really, here’s a simple thing you should always do: 👉 Also export the “naked” component! I am talking about something like this: // … export { […]