Brian Emil Hartz

let me = enjoy ( pondering ( javascript ( reactjs ) ) )

React OnError Image Component

I tweeted the other day about image onError react component. The below tweet and attached component are a great start.

But I'd like to create one that has some self contained state that updates based onError and uses recompose!

The below component uses recompose to hold image state, add onError callbacks, and attach lifecycle methods. I also feel it adds easy to reason about flow and good separation of concerns to create an overall strong reusable image component.