Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with preview and fallback #83

Open
LeComptoirDesPharmacies opened this issue Mar 22, 2021 · 2 comments
Open

Issue with preview and fallback #83

LeComptoirDesPharmacies opened this issue Mar 22, 2021 · 2 comments

Comments

@LeComptoirDesPharmacies

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

@shaodahong
Copy link
Member

yep, if error src and provide a fallback, preview not work, because preview depend on src, fallback now only display when load src error

@LeComptoirDesPharmacies
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant