Josesito
Josesito
Explore posts from servers
SSolidJS
Created by Josesito on 10/27/2024 in #support
can I import a `named export` while lazy loading the `default export`?
Not sure how lazy loading works, I want to ask if this breaks lazy loading:
export const path = "/login"
export default (function LoginScreen() {...}) satisfies Component
export const path = "/login"
export default (function LoginScreen() {...}) satisfies Component
import { path as loginPath } from "#route/login" // this import is outside the `lazy()` function, is this ok?

const routes = [{
path: loginPath,
component: lazy(() => import("#route/login")),
}]
import { path as loginPath } from "#route/login" // this import is outside the `lazy()` function, is this ok?

const routes = [{
path: loginPath,
component: lazy(() => import("#route/login")),
}]
4 replies