Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@foseberg/react-useloading

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foseberg/react-useloading

Reusable hook to create loading states in react

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Introduction

UseLoading allows you to easily add loading states to your elements by following a simple pattern of adding a data-loading property to the elements you want to trigger loading states on:

import useLoading from 'useLoading'


const Card = ({ loading }: ICardProps) => {
  const ref = useLoading(loading, 'loadingClass');

  return (
    <div className="card" ref={ref}>
      <h1 className="card-title" data-loading>
        This is a title
      </h1>
      <p className="card-description" data-loading>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris
        imperdiet orci eget nunc mattis faucibus. In a purus turpis. Cras
        condimentum diam nec consequat cursus.
      </p>

      <Image />

      <div className="card-price" data-loading>
        1000$
      </div>
    </div>
  );
};

export default Card;

FAQs

Package last updated on 04 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc