1.1.2 • Published 1 year ago

react-lazy-loading-func v1.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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.