Skip to content

hungnv1997/lazyLoadWithRetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lazyLoadWithRetry

If the file cannot be downloaded during navigation due to an error or network issue, the app may crash as React.lazy fails to import the component. To handle this situation gracefully, it's important to implement proper error handling and retry mechanisms to ensure smooth performance of the application. react-lazy-load-with-retries will help you fix this issue.

react-lazy-load-with-retries

Usage

npm i react-lazy-load-with-retries
import { Suspense } from 'react';
import { lazyLoadWithRetries } from 'react-lazy-load-with-retries';

function App() {
    const MyButton = lazyLoadWithRetries(()=> import('./lib/MyButton'))
    return (
        <>
            <Suspense fallback="<div>Loading</div>">
            <MyButton/>
            </Suspense>
        </>
    );
}


export default App;

Authors

Badges

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published