@@ -113,6 +113,32 @@ export default function dynamic<P = {}>(
// Support for passing options, eg: dynamic(import('../hello-world'), {loading: () => <p>Loading something</p>})
loadableOptions={...loadableOptions,...options}
if(
typeofdynamicOptions==='object'&&
!(dynamicOptionsinstanceofPromise)
){
// Support for `render` when using a mapping, eg: `dynamic({ modules: () => {return {HelloWorld: import('../hello-world')}, render(props, loaded) {} } })
if(dynamicOptions.render){
loadableOptions.render=(loaded,props)=>
dynamicOptions.render!(props,loaded)
}
// Support for `modules` when using a mapping, eg: `dynamic({ modules: () => {return {HelloWorld: import('../hello-world')}, render(props, loaded) {} } })