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

Animation isn't happening till entire page loads #257

Open
mouryareddy opened this issue Sep 2, 2021 · 11 comments
Open

Animation isn't happening till entire page loads #257

mouryareddy opened this issue Sep 2, 2021 · 11 comments

Comments

@mouryareddy
Copy link

mouryareddy commented Sep 2, 2021

The animation should happen as soon as possible. Instead, it is happening after the entire page is loaded. Till the entire page loads, It's static.

@fandiario
Copy link

fandiario commented Sep 6, 2021

Have some problem with this. I'm using next js and also set SSR to false... Wonder where did i go wrong...

image

and my skeleton loader

image

I'm using next 11.0.1 and react-content-loader 6.0.3

@kalinkochnev
Copy link

I had the same issue. First make sure that you don't have any blocking function calls, but I think the issue has to do something with the use of svg animations vs css. I had other css animations that were working fine, but this package got hung until the async functions finished.

@mouryareddy
Copy link
Author

I am using a fetch call , and loading this till I get result. Do you have that CSS property handy so that I could add it.

@kalinkochnev
Copy link

kalinkochnev commented Sep 8, 2021

I am using a fetch call , and loading this till I get result. Do you have that CSS property handy so that I could add it.

Sorry I probably didn't explain what I meant clearly. I was only saying that css animations appear to work while the page is loading, but the SVG ones do not, so the issue is related to the SVG animations. I haven't figured the issue out either.

I don't think there's a good way to fix it without drastically changing the SVG animations, but for a temporary fix, you could make some css classes that have a similar effect and style the rect tags, while disabling the animate prop.

@RohithBhandaru
Copy link

I'm also facing similar issue. I have a screen which has a graph with large data and a list with corresponding data points to be rendered. I wanted to place content loader while the graph screen gets rendered. However, the content loader animation doesn't even start before the graph screen gets rendered. I'm new to react native.

Am I missing something here? Any help is appreciated.

@hubsmoke
Copy link

hubsmoke commented Mar 7, 2022

Also having this issue, I think it's related to browsers not prioritizing SVG animations. If this is correct, this project should offer a CSS solution by overlaying 2 SVGs and using an animation on the css mask-position to simulate the loading animation. I may cook this up as a PR if I don't find another solution.

My target platform is web BTW. I am not planning on using this for React Native

EDIT: I have decide to use this instead, which animates without delay https://github.com/dvtng/react-loading-skeleton I do like the tooling for react-content-loader project better (ability to customize skeleton layout with a UI) but the animation delay problem renders it unusable for me. This seems to be a new problem, it was working perfectly at one point, but perhaps browser support changed in webkit.

@cwveysey
Copy link

Also having this problem -

@kostas64
Copy link

Same problem. animation takes tool long before start

@nenorrell
Copy link

Also having this issue. It's problematic when using this as a fallback for Suspense components, as there is no animation since it doesn't animate until the page loads (at which point, the fallback is no longer needed)

@27shutterclicks
Copy link

Same here, svg and lottie animations weren't animating until async data fetches complete, so I couldn't get this component to work - on Next.js with SSR. I switched to react-loading-skeleton, thanks to @hubsmoke 's suggestion above and it's working great.

@shehi
Copy link

shehi commented Apr 14, 2024

Yup... With Next.js 14 and RSC (react server components) this ain't working: page won't finish loading until async processes are done (Suspense) and when that happens, react-content-loader is gone anyway. Makes this component's animations impossible to show.

@danilowoz, this is a critical issue, considering you had v7 release just a month ago!!!

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

10 participants