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

When load a remote SVG from url , is there a callback about svg is rendered/visible? #1528

Closed
Xi-gofore opened this issue Feb 10, 2021 · 2 comments

Comments

@Xi-gofore
Copy link

I am loading a remote SVG from a url like below:

import * as React from 'react';
import { SvgUri } from 'react-native-svg';

export default () => (
  <SvgUri
    width="100%"
    height="100%"
    uri="https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/Steps.svg"
  />
);

The problem is it takes about 10 seconds to have the SVG image be visible on the screen, I think it depends on the network connection. For a better user experiences, I would like to show a loading spinner until the SVG is rendered/visible. But is there a callback for me to do that? If no, do you have any suggestion how to show a loading spinner until SVG is rendered/visible?

@bernhardoj
Copy link

I need this too

@bohdanprog
Copy link
Member

Hello @Xi-gofore,

I believe you can manage the image loading state. You mentioned displaying a spinner until the image loads and then showing the image afterward.
If you still have any questions feel free to open an issue.
Thank you.

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

3 participants