Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

524
Views
How to implement React-loading-skeleton properly?

I'm trying to implement react-loading-skeleton library in my project.

Code of skeleton component:

import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'
import 'react-loading-skeleton/dist/skeleton.css'

const MySkeleton: FC = () => {
    return (
        <SkeletonTheme baseColor="#000" highlightColor="#444" width={200} height={200}>
            <Skeleton circle={true}/>
        </SkeletonTheme>
    )
}

export default MySkeleton 

Code of webpack config:

...
{
    test: /\.(scss|css)$/,
    //exclude: /node_modules/,  => needed to avoid for react-skeleton-loading work
    use: [
        'style-loader',
        {
            loader: 'css-loader',
            options: {
                modules: {
                    localIdentName:
                        '[name]__[local]--[hash:base64:5]',
                },
            },
        },
        'sass-loader',
    ],
},
...

Problem: skeleton component is rendered (it's showed in the DOM) but there is no sign of it on the screen. Two spans (one inside another - Skeleton component) rendered in the DOM, but styles (not from SkeletonTheme nor Skeleton) are used on it. DOM shows that styles are used on the element but I cannot see it on the screen.

P.S: I tried to use style property inside Skeleton and SkeletonTheme components - didn't work

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!