Got rid of mod_import (#1547)
This commit is contained in:
parent
1d0a34a3f5
commit
9f7a7a1e4a
@ -788,10 +788,4 @@ class NoSSRComponent(Component):
|
|||||||
def _get_custom_code(self) -> str:
|
def _get_custom_code(self) -> str:
|
||||||
opts_fragment = ", { ssr: false });"
|
opts_fragment = ", { ssr: false });"
|
||||||
library_import = f"const {self.tag} = dynamic(() => import('{self.library}')"
|
library_import = f"const {self.tag} = dynamic(() => import('{self.library}')"
|
||||||
mod_import = (
|
return "".join((library_import, opts_fragment))
|
||||||
# https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#with-named-exports
|
|
||||||
f".then((mod) => mod.{self.tag})"
|
|
||||||
if not self.is_default
|
|
||||||
else ""
|
|
||||||
)
|
|
||||||
return "".join((library_import, mod_import, opts_fragment))
|
|
||||||
|
Loading…
Reference in New Issue
Block a user