image
image copied to clipboard
Issue with preview and fallback
Hi,
We have got a problem with preview being unavailable when 'src' is wrong and 'fallback' is used. We found your example here but it does not seems to work : https://github.com/react-component/image/blob/d78487df5467a9ed00a9f7b51be33d1298e7e1b7/docs/examples/fallback.tsx
Here is a reproducer : https://codesandbox.io/s/polished-leaf-svmdt?file=/src/App.js:360-371
Thanks in advance for clarifications about misuse on our side or bug discovery. Yours faithfully, LCDP
yep, if error src and provide a fallback, preview not work, because preview depend on src, fallback now only display when load src error
O.K ! Do you think that it should stay like this or enhancement can be considered ?
If no enhancement considered, we will simulate fallback property on higher level by wrapping your component and replacing "src" value dynamically when "onError" callback is called. Do you see any contraindication to this ?
Yours faithfully, LCDP