In javascript, code splitting can make bundle sizes smaller. But, if the network is flaky, then resources may fail to load, producing an error like ChunkLoadError: Loading chunk 2361 failed. (error: https://example.com/static/js/2361.e059ff5a.chunk.js)
How can we allow a user to manually retry a reload of a code split react component?
Existing solutions sometimes involve an auto-retry method like this https://dev.to/goenning/how-to-retry-when-react-lazy-fails-mb5 but I would like a manual click-to-retry, it gives user more control
I did see one mention of it here that a user created a button to retry, but it is not a worked example. Any idea how to fix https://github.com/facebook/react/issues/14254#issuecomment-661943960