Skip to content

Loader is flickering #33

Open
Open

Description

@Kisama

there is a flickering when the loader is initialized

looks render with default props and rerender with new props

2024-12-03.5.22.49.mov

Activity

  1. DrZanuff commented on Dec 4, 2024

    @DrZanuff
    Contributor

    @Kisama are you using SSR (e.g. Next.JS)?

    In that case you must include the css in your bundle.css manually, like in the docs:

    Server Side Rendering

    While the library works with SSR, the spinner's animation CSS will be attached to the head only on the hydrate phase, which means the spinners will start animating only after the page is fully loaded. To work around this, include the needed css in your bundle.css manually:

    /* App.css */
    
    /* to load animation for a specific spinner */
    @import "~spinners-react/lib/SpinnerCircular.css";
    
    /* to load animations for all spinners at once */
    @import "~spinners-react/lib/index.css";
    

    https://github.com/adexin/spinners-react/blob/master/README.md?plain=1#L57

  2. Kisama commented on Mar 14, 2025

    @Kisama
    Author

    No, I am using react app with tailwindcss like

    <div className='flex h-full w-full flex-col items-center justify-center gap-4'>
          <SpinnerCircularFixed
            size={size}
            enabled={enabled}
            thickness={(100 / 4) * thickness} 
            color={color}
            secondaryColor={secondaryColor}
          />
          {message && <div className='type-h4-600 text-[var(--text-primary)]'>{message}</div>}
    </div>
    
  3. adexin-team commented on Apr 27, 2025

    @adexin-team
    Contributor

    It looks like the layout styles or passed properties update issue.
    Could you possibly provide some simple demo showing the issue?
    Here's the create-react-app example that can be uses as a starting point: spinners-cra-tailwind
    Currently it doesn't seem to show signs of flickering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions