loadable-components/packages/codemod/transforms/__testfixtures__/react-loadable-to-loadable-component_expr.output.js

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,
}),
})