React OnError Image Component
I tweeted the other day about image onError react component. The below tweet and attached component are a great start.
A small #React Universal/Isomorphic Image onError Component https://t.co/J4eYM4iyEm @reactjs pic.twitter.com/LZkJl20iJF
— Brian Emil Hartz (@hartzis) July 14, 2016
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.