🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-lazy-loading-func

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-lazy-loading-func

React lazy loading hook

1.1.2
latest
Source
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
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

react

FAQs

Package last updated on 03 Mar 2023

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