0.0.2 • Published 1 year ago

react-lazy-load-with-retries v0.0.2

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

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

0.0.2

1 year ago

0.0.1

1 year ago