Socket
Socket
Sign inDemoInstall

react-lazy-loading-func

Package Overview
Dependencies
7
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-lazy-loading-func

React lazy loading hook


Version published
Maintainers
1
Created

Readme

Source

React lazy loading function

This is a React hook that allows you to use the lazy loading function in your react app. Main Concept of this function is to load the component only when it is needed.This package will be helpful if your component have not default export also it will be helpful if you want to lazy load the component which is not in the same folder.

Installation

Use the package manager npm/yarn to install the package.((please read the documentation first))

npm i react-lazy-loading-func
yarn add react-lazy-loading-func

Importing

import lazyLoad from "react-lazy-loading-func";

How to use it

lazyLoad(path,componentName)
const Home= lazyLoad("./Home/Home","Home")

Here path is the path of the component and componentName
 is the name of the component which you want to import.

Keywords

FAQs

Last updated on 03 Mar 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc