mirror of
https://github.com/gregberge/loadable-components.git
synced 2026-01-18 15:12:26 +00:00
20 lines
435 B
JavaScript
20 lines
435 B
JavaScript
/* eslint-disable */
|
|
import loadable from '@loadable/component'
|
|
|
|
const Loading = props => {
|
|
if (props.error || props.timedOut) {
|
|
throw new Error('Failed to load custom link chunk')
|
|
} else {
|
|
return null
|
|
}
|
|
}
|
|
|
|
const CustomLinkLoadable = loadable(() =>
|
|
import(/* webpackChunkName: "custom-link" */ '@components/CustomLink/Link'), {
|
|
fallback: Loading({
|
|
pastDelay: true,
|
|
error: false,
|
|
timedOut: false,
|
|
}),
|
|
})
|